-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting attributes for unstored Dict nodes fails silently #2883
Comments
@borellim So, the problem with
I understand how this case could be confusing, but I really don't think there is much to be done except maybe adding some emphasis in the documentation that In the other two cases, yes, you are referencing the dict that is stored inside. The problem with
Finally,
No tests failed for me after these modification. In both cases I am using the intrinsic @sphuber let me know what you think of these modifications, if they are ok I will add some tests to try these direct accesses and make a PR. |
The reason you cannot set dictionary content through attributes is that there would be a potential clash in properties that are generic to the This is also the very reason for the existence of the With respect to |
Just a self reminder for my own understanding: |
I'm confused by a behaviour of the
Dict
class. I want to update an unstored noded = Dict()
, so I do the following:d.x = 1
d.dict.x = 1
Neither of these commands raises an error, but the dictionary is still empty if I do
print(d.get_dict())
. I would expect them to either work or raise an error.For context, the following gives an explicit error instead (which I'm also not sure why):
d['x'] = 1 # TypeError: 'Dict' object does not support item assignment
While the following actually works:
d.update_dict({'x':1})
The text was updated successfully, but these errors were encountered: