You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do nothing (requires # pyright:ignore because type of attribute is inferred as None.).
In the definition of Entity change to:
classEntity: # properties and state of physical world entitydef__init__(self):
...
self.max_speed : bool|None=None
...
In the definition of Entity change to:
classEntity: # properties and state of physical world entitydef__init__(self):
...
@propertydefmax_speed(self):
ifself._max_speedisNone:
raiseNotImplementedErrorreturnself._max_speed@max_speed.setterdefmax_speed(self, val : float):
self._max_speed=val
Something else.
In the most recent PR (#1 ), I took option 3, but I don't have an especially strong stance.
Would love to hear any thoughts folks might have on this!
The text was updated successfully, but these errors were encountered:
This issue is a place to discuss the convention for attributes initialized as None specifically in the situation where:
__init__
None
and have to be assigned.if self.attribute is None: ...
For concreteness, let's focus on a specific example of this. In the current Petting Zoo implementation we have:
and then, in Simple Tag:
Possible Proposals
# pyright:ignore
because type of attribute is inferred asNone
.).Entity
change to:Entity
change to:In the most recent PR (#1 ), I took option 3, but I don't have an especially strong stance.
Would love to hear any thoughts folks might have on this!
The text was updated successfully, but these errors were encountered: