Skip to content
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

TODO: deal with container namespace between widget parameters and user names #557

Open
tlambert03 opened this issue May 3, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@tlambert03
Copy link
Member

from magicgui.experimental import guiclass
@guiclass
class Person:
    name: str

Person('Alice').gui
File ~/dev/self/magicgui/src/magicgui/widgets/bases/_container_widget.py:336, in ContainerWidget.update(self, mapping, **kwargs)
    334     items = mapping.items() if isinstance(mapping, Mapping) else mapping
    335     for key, value in items:
--> 336         getattr(self, key).value = value
    337 for key, value in kwargs.items():
    338     getattr(self, key).value = value

AttributeError: 'str' object has no attribute 'value'

thats because Container.name conflicts with Person.name

@tlambert03 tlambert03 added the bug Something isn't working label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant