-
Notifications
You must be signed in to change notification settings - Fork 19
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
issue #41: backport the pure python suggestion code from 3.12 #42
Conversation
otherwise NameError/AttributeError suggestions break when using exceptiongroup on 3.10 (and on PyPy)
Passing tests would be good :) |
That too ;-) |
of course it passes locally on 3.10 and pypy, otherwise I wouldn't have pushed. how do you usually run tests locally? |
I usually just run |
so 3.11 fails, because there |
I'm a bit confused; the test suite should not be calling |
Ok so, let me change the question. With |
no monkeypatching is done there anyway
Yes, that reasoning makes a lot of sense, I just did that. |
Goodie! Anything missing from the PR? I see it's still marked as draft. |
no, good from my side |
Thanks! |
awesome, thank you! |
So currently in Python 3.11.0, the suggestions for >>> class Foo:
... def _bar(self):
... return 42
...
>>> foo = Foo()
>>> foo.bar
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Foo' object has no attribute 'bar'. Did you mean: '_bar'?
>>> try:
... foo.bar
... except AttributeError as e:
... print(e)
...
'Foo' object has no attribute 'bar' Is this supposed to change during some patch release of 3.11.x? |
From what I understood, this would be changing in Python 3.12. It's a non-issue on 3.11 as this project doesn't do monkey patching on that version (or any subsequent versions). |
Thanks. Then perhaps the issue we are seeing in astropy/astropy#14005 is actually an upstream usage of |
First attempt. Code is from here: python/cpython@bbc7cd6
I suppose a few more tests would be good?