Skip to content

Commit

Permalink
Add regression tests of inference of implicit None return
Browse files Browse the repository at this point in the history
  • Loading branch information
nelfin committed May 24, 2021
1 parent 5ebbc30 commit b893c94
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# pylint: disable=missing-docstring,pointless-statement,invalid-name,no-self-use

class A:
def func(self):
print('hello')

@property
def index(self):
print('world')


# Since these are not assigned anywhere, assignment-from-none etc.
# in typecheck does not warn

a = A()
# double call is workaround for #4426
a.func()() # [not-callable]
[1, 2, 3][a.index] # [invalid-sequence-index]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
not-callable:17:0::a.func() is not callable
invalid-sequence-index:18:0::Sequence index is not an int, slice, or instance with __index__

0 comments on commit b893c94

Please sign in to comment.