Conversation
|
|
||
| # update width and height attributes | ||
| width, height, x, y = self._parse_geometry_string(geometry_string) | ||
| width, height, *_ = self._parse_geometry_string(geometry_string) |
There was a problem hiding this comment.
What's this *_? I've never seen that before.
There was a problem hiding this comment.
x and y were unused in that context. Python uses the convention of naming unused variables as _. *_ does a tuple unpack operation and can be thought of as an *args parameter used in functions.
There was a problem hiding this comment.
Also, there's multiple places in the code that require attention. Redundant None checks, incorrect default values to name a few. It prevents a complete type hinting of the codebase.
I am unfamiliar with the actual logic and considering that tkinter itself is a very poor API, I leave it as is
There was a problem hiding this comment.
I discovered this library a month ago and have been making simple fixes and formatting changes in my fork. I need to do a deeper dive to learn how it really works/is supposed to work.
|
Can you add toast messages functionality in CTk? 🥹 |
|
Perhaps a Pylint Github action... |
|
Hi, I've planned to add Type Hints myself in the near future. If you don't want to redo the work again, since I like your work on the Import clauses, you could create a new PR dedicated to that. |
|
|
Oh, I didn't know that. |
Yeah. The pipe is used instead of |
|
I meant: for Python 3.7 specifically, is it good practice to use |
Highlights:
__future__.annotations(3.7+ feature, which customtkinter supports).This is a big PR, it will need a few inputs and revisions from you and me.
⚠️ There are quite a few places where redundant code is present.
⚠️ The unit tests raise a lot of errors and they need to be updated.
I have left type hinting to you or used
Anyat ambiguous places.There are some glaring code quality issues all over; along with the lack of docstrings at many places.
I highly suggest you to integrate
ruffandblackin your pre-commit hooks or atleast in your workflow.