-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Crash maximum recursion depth exceeded
- something to do with decorators
#4982
Comments
I can reproduce the crash, but as I see it, the given example is not valid Python code. class sim(bar) Instead, you'd need to unpack the list of subclasses: class sim(*bar) With this modification, |
Right but |
Yes, that is true. |
The following is valid Python and still produces the crash: class Base:
@classmethod
def get_first_subclass(cls):
for subclass in cls.__subclasses__():
return subclass
return object
subclass = Base.get_first_subclass()
class Another(subclass):
pass This is based on real code by the way; not a contrived example. |
Thank you for the additional example. |
i can reproduce the error using your examples in this env:
but not in this env where the same error occurred on other Python files 😹 :
in both envs, if i put the python files inside a directory, say,
then everything is fine, no errors 🤔 |
Bug description
When parsing the following file:
and
verif/sim.py
ispylint crashed with a
RecursionError
and with the following stacktrace:Command used
Pylint output
Expected behavior
It shouldn't crash.
Pylint version
OS / Environment
CentOS Linux release 7.9.2009 (Core)
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: