-
- Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Control flowRequires control flow understandingRequires control flow understandingHacktoberfestHelp wanted 🙏Outside help would be appreciated, good for new contributorsOutside help would be appreciated, good for new contributorsHigh effort 🏋Difficult solution or problem to solveDifficult solution or problem to solveHigh priorityIssue with more than 10 reactionsIssue with more than 10 reactions
Description
Steps to reproduce
- create a file called test.py containing the following:
def frob(value=None): if value is not None: return -value return valuepylint test.py
Current behavior
pylint output contains E: 3,15: bad operand type for unary -: NoneType (invalid-unary-operand-type)
Expected behavior
There should be no invalid-unary-operator-type error for this line because it is not possible for value to be None here
pylint --version output
pete@dev:~$ pylint --version No config file found, using default configuration pylint 1.7.1, astroid 1.5.2 Python 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4] mastermatt, nschloe, spmaniato, ctallec, JVillella and 29 more
Metadata
Metadata
Assignees
Labels
Control flowRequires control flow understandingRequires control flow understandingHacktoberfestHelp wanted 🙏Outside help would be appreciated, good for new contributorsOutside help would be appreciated, good for new contributorsHigh effort 🏋Difficult solution or problem to solveDifficult solution or problem to solveHigh priorityIssue with more than 10 reactionsIssue with more than 10 reactions