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
{{ message }}
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.
Hello bcj,
When i pass {'get': 'example'} to __init__ method, instance created, but i cant access dict key by getattr since __init__ method only add no-conflict key as instance property.
But when i user attrdict_instance.property = "example", it raise a key error.
The question is : this two place acts not the same way.(__init__ and setattr)
Dict has key get but i can't access it(if i haven't read source code , i wouldn't know how can i access it correctly.)
Would __init__ method raises a KeyError to tell user do not use reserved key-name when collision being caught be a better way?
Best wishes:)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello bcj,
When i pass
{'get': 'example'}
to__init__
method, instance created, but i cant access dict key bygetattr
since__init__
method only add no-conflict key as instance property.But when i user
attrdict_instance.property = "example"
, it raise a key error.The question is : this two place acts not the same way.(
__init__
andsetattr
)Dict has key
get
but i can't access it(if i haven't read source code , i wouldn't know how can i access it correctly.)Would
__init__
method raises a KeyError to tell user do not use reserved key-name when collision being caught be a better way?Best wishes:)
The text was updated successfully, but these errors were encountered: