-
-
Notifications
You must be signed in to change notification settings - Fork 3k
[refactor] Remove code that "disables deprecation warnings about \u" #19606
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
base: master
Are you sure you want to change the base?
[refactor] Remove code that "disables deprecation warnings about \u" #19606
Conversation
Probably now useless: it doesn't seem to do anything anymore as far as I can tell. And I checked a couple of things, and old documentation. This is essentially a revert of python#7635 aka python@bd00106, although not 100% exactly.
This comment has been minimized.
This comment has been minimized.
Oh cool, there actually is a difference. It's a little bit inscrutable to me, and hard to determine what it should actually do, but at least it's something! |
mypy/test-data/unit/parse.test Line 115 in db67fac
|
|
Thanks for taking the initiative of looking into this! A few notes to hopefully clarify what's going on:
|
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
It's still passing on ≥ 3.12; curious. |
Just in case my earlier comment wasn't clear, this code is working as intended, so I wouldn't spend more time trying to get the tests to pass with it removed |
Oh, I understood that — although I appreciate the potential clarification. My last push was trying to investigate the necessity of changing what we catch to SyntaxWarning on Python >=3.12. So I'm surprised by the still-passing part, not the still-failing part 🙂. But I need to ponder it further before drawing hard conclusions. |
Ok, great! Just didn't want you to lose time working on something that couldn't be merged :-) The reason the tests pass on 3.12+ is because Lines 228 to 230 in db67fac
|
I believe this code is now useless: it doesn't seem to do anything as far as I can tell.
The real puzzler is that I can't figure out when \u would have triggered a DeprecationWarning at all. And I tried a couple of things, and checked a lot of versions of the documentation. I even downloaded a couple old python versions, including Python 2.7, to try to trigger one with their versions of parse, and got nothing. But perhaps there's some combination I didn't think of.
This is essentially a revert of #7635 aka bd00106, although not 100% exactly.
I do not believe this changes any behavior, and therefore did not write a test. I wish the original PRer had written a test so I knew what I was looking for!