Skip to content

isinstance-type-none (FURB168)

Derived from the refurb linter.

Fix is sometimes available.

What it does

Checks for uses of isinstance that check if an object is of type None.

Why is this bad?

There is only ever one instance of None, so it is more efficient and readable to use the is operator to check if an object is None.

Example

isinstance(obj, type(None))

Use instead:

obj is None

Fix safety

The fix will be marked as unsafe if there are any comments within the call.

References

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy