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

Pyupgrade patch 3 #16

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Pyupgrade patch 3 #16

wants to merge 16 commits into from

Conversation

echoix
Copy link
Owner

@echoix echoix commented Dec 26, 2023

No description provided.

Might need a second look to make sure the message protocol handled strings correctly. The check was different than others.

See https://docs.astral.sh/ruff/rules/type-of-primitive/
Some other cases were flagged and could have been automatically fixed, but I wasn't confident enough to apply them now.

See https://docs.astral.sh/ruff/rules/extraneous-parentheses/
Some existing calls already called it without the extra parentheses. From the wxPython docs, I understand that GetBestSize returns a wx.Size object, and the BestSize() can accept wx.size, a tuple of (x,y), or two arguments, like x and y separately (at least for https://docs.wxpython.org/wx.lib.agw.aui.framemanager.AuiPaneInfo.html?highlight=bestsize#wx.lib.agw.aui.framemanager.AuiPaneInfo.BestSize)
The sequence `\.` is an undefined escape sequence, but can be found in regex-strings. In regex strings, we usually want the backslash character and the dot character, instead of escaping dot like if it was a tab character `\t`. This is what raw strings (strings prefixed with r) do: they treat backslashes as literal characters.

In Python 3.12, using `\.` in a string (not raw strings) raises `SyntaxWarning: invalid escape sequence '\.'`
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

Successfully merging this pull request may close these issues.

1 participant