Skip to content

Version 1.15.0

Compare
Choose a tag to compare
@dosisod dosisod released this 24 Mar 06:17
· 161 commits to master since this release
2c336ac

This version adds 3 new checks!

Add use-long-regex-flag check (FURB167)

Regex operations can be changed using flags such as re.I, which will make the regex case-insensitive. These single-character flag names can be harder to read/remember, and should be replaced with the longer aliases so that they are more descriptive.

Bad:

if re.match("^hello", "hello world", re.I):
    pass

Good:

if re.match("^hello", "hello world", re.IGNORECASE):
    pass

Add no-isinstance-type-none (FURB168)

Checking if an object is None using isinstance() is un-pythonic: use an is comparison instead.

Bad:

x = 123

if isinstance(x, type(None)):
    pass

Good:

x = 123

if x is None:
    pass

Add no-is-type-none check (FURB169)

Don't use type(None) to check if the type of an object is None, use an is comparison instead.

Bad:

x = 123

if type(x) is type(None):
    pass

Good:

x = 123

if x is None:
    pass

What's Changed

Full Changelog: v1.14.0...v1.15.0