-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for crash on inference of
__len__
- Loading branch information
1 parent
0a1ebd4
commit 45433cf
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"""Test package for the crash reported in #5244 | ||
https://github.com/PyCQA/pylint/issues/5244""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Module docstring""" | ||
|
||
|
||
class MyClass: | ||
"""Class to test crash reported in: | ||
https://github.com/PyCQA/pylint/issues/5244 | ||
""" | ||
|
||
def __init__(self, array): | ||
self.array = array | ||
|
||
def __len__(self): | ||
"""Initially reported crash crashed on this function def""" | ||
return len(self.array) | ||
|
||
def public_method(self): | ||
"""docstring""" | ||
print(self.array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters