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
As of Python 3.7, Python's parsing of PEP 526 type annotations does not report replicated attributes properly. A replicated attribute name with default value(s) is not consistent in namespace and namespace['__annotations__']. namespace['__annotations__'] contains the attribute's last type BUT its order there reflects its FIRST declaration. And namespace contains the attribute's LAST default value. This example illustrates the problem, with EventMessage defined below.
class ExampleEventMessageWithReplicatedAttr(EventMessage):
name: str = 'hi'
unit_price: float
quantity_on_hand: int = 0
name: float = 1.1
name: int
The text was updated successfully, but these errors were encountered:
As of Python 3.7, Python's parsing of PEP 526 type annotations does not report replicated attributes properly. A replicated attribute name with default value(s) is not consistent in
namespace
andnamespace['__annotations__']
.namespace['__annotations__']
contains the attribute's last type BUT its order there reflects its FIRST declaration. And namespace contains the attribute's LAST default value. This example illustrates the problem, with EventMessage defined below.The text was updated successfully, but these errors were encountered: