-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Do not crash if next()
is called without arguments
#7831
Conversation
Pull Request Test Coverage Report for Build 3543376537
π - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks :) We're going to have to fix the stdlib primer before merging.
@@ -1135,6 +1135,10 @@ def _looks_like_infinite_iterator(param: nodes.NodeNG) -> bool: | |||
# A next() method, which is now what we want. | |||
return | |||
|
|||
if len(node.args) == 0: | |||
# builtin next method should never be called without args. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# builtin next method should never be called without args. | |
# handle cases where builtin.next was called with args. | |
# see https://github.com/PyCQA/pylint/issues/7828 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "handle cases where builtin.next was called withOUT args."?
doc/whatsnew/fragments/7828.bugfix
Outdated
@@ -0,0 +1,3 @@ | |||
Fixes a crash during ``stop-iteration-return`` if builtin ``next`` is called without arguments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes a crash during ``stop-iteration-return`` if builtin ``next`` is called without arguments. | |
Fixes a crash in ``stop-iteration-return`` when the ``next`` builtin is called without arguments. |
opened #7832 to see who can pick it up. I may be able to later today but it's pressing so first comes first gets! |
This comment has been minimized.
This comment has been minimized.
7f373b9
to
ace4c1d
Compare
This comment has been minimized.
This comment has been minimized.
Blocked by #7826 |
ace4c1d
to
fc146c7
Compare
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit fc146c7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
next()
is called without arguments
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> (cherry picked from commit a9c1cda)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> (cherry picked from commit a9c1cda)
Type of Changes
Description
Pylint should not crash if
next()
is called, even tho that's incorrect python!Closes #7828