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

guiclass and the name reserved keyword #684

Open
bruno-f-cruz opened this issue Dec 20, 2024 · 1 comment · May be fixed by #688
Open

guiclass and the name reserved keyword #684

bruno-f-cruz opened this issue Dec 20, 2024 · 1 comment · May be fixed by #688
Labels
bug Something isn't working

Comments

@bruno-f-cruz
Copy link

bruno-f-cruz commented Dec 20, 2024

Describe the bug
If your data model has a property called name the example provided on the website crashes

To Reproduce

from magicgui.experimental import guiclass, button

@guiclass
class MyDataclass:
    a: int = 0
    name: str = 'hello'
    c: bool = True

    @button
    def compute(self):
        print(self.a, self.b, self.c)

obj = MyDataclass(a=10, name='foo')
obj.gui.show()

Expected behavior
The example should run if the property is called name

Screenshots

Environment (please complete the following information):

  • OS: Win
  • backend: QT
  • magicgui version 0.10.0
@bruno-f-cruz bruno-f-cruz added the bug Something isn't working label Dec 20, 2024
@tlambert03
Copy link
Member

thanks for reporting @bruno-f-cruz, I remember running into this myself. Definitely no good. I thought there was an open issue for this but can't find it, so thanks for creating one

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
2 participants