What's New In Pylint 1.9¶
- Release
1.9
- Date
2018-05-15
Summary -- Release highlights¶
None so far
New checkers¶
A new Python 3 checker was added to warn about the removed
operator.divfunction.A new Python 3 checker was added to warn about accessing functions that have been moved from the urllib module in corresponding subpackages, such as
urllib.request.from urllib import urlencode
Instead the previous code should use
urllib.parseorsix.movesto import a module in a Python 2 and 3 compatible fashion:from six.moves.urllib.parse import urlencode
To have this working on Python 3 as well, please use the
sixlibrary:six.reraise(Exception, "value", tb)
A new check was added to warn about using unicode raw string literals. This is a syntax error in Python 3:
a = ur'...'
Added a new
deprecated-sys-functioncheck, emitted when accessing removedsysmembers.Added
xreadlines-attributecheck, emitted when thexreadlines()attribute is accessed on a file object.Added two new Python 3 porting checks,
exception-escapeandcomprehension-escapeThese two are emitted whenever pylint detects that a variable defined in the said blocks is used outside of the given block. On Python 3 these values are deleted.
try: 1/0 except ZeroDivisionError as exc: ... print(exc) # This will raise a NameError on Python 3 [i for i in some_iterator if some_condition(i)] print(i) # This will raise a NameError on Python 3
Other Changes¶
defaultdictand subclasses ofdictare now handled for dict-iter-* checks. That means that the following code will now emit warnings for wheniteritemsand friends are accessed:some_dict = defaultdict(list) ... some_dict.iterkeys()
Enum classes no longer trigger
too-few-methodsSpecial methods now count towards
too-few-methods, and are considered part of the public API. They are still not counted towards the number of methods fortoo-many-methods.docparams allows abstract methods to document returns documentation even if the default implementation does not return something. They also no longer need to document raising a NotImplementedError.
