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

Code - Code Script - Generate -> Expected type 'int', got 'str' instead #114

Closed
matecsaj opened this issue Apr 16, 2022 · 3 comments
Closed
Milestone

Comments

@matecsaj
Copy link

sample output

self.consider_item_description.grid(column="0", columnspan="2", row="3")
self.window_pained.add(self.frame2, weight="1")

The keyword arguments should be integers instead of strings.

@jrezai
Copy link
Contributor

jrezai commented May 27, 2022

I don't think it will affect the usability when strings are used instead of integers.

When Tkinter expects a number (ie: row=3), it still works fine with row="3" given as a string.
I believe the reason it's fine with strings when it's expecting a number is because Tkinter uses TCL under the hood, and apparently in TCL everything is a string.

I'm not a TCL expert by any stretch, but that seems to be the most logical explanation I can think of as to why Tkinter works fine with integers and also strings.

@rdbende
Copy link
Contributor

rdbende commented May 27, 2022

Yes, it works just fine with strings, because Tkinter translates every object to string under the hood anyway.
But it's just more Pythonic to use integers instead of string everywhere.

@alejandroautalan
Copy link
Owner

Hello all, thanks for the comments.
I change it to be more pythonic. It will be available in the next release.

Regards.
Alejandro A.

@alejandroautalan alejandroautalan added this to the Version 0.27 milestone May 28, 2022
alejandroautalan added a commit to alejandroautalan/pygubu that referenced this issue May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants