]> granicus.if.org Git - python/commitdiff
bpo-33534: Remove unneeded test. (GH-6897)
authorEric V. Smith <ericvsmith@users.noreply.github.com>
Wed, 16 May 2018 11:24:00 +0000 (07:24 -0400)
committerGitHub <noreply@github.com>
Wed, 16 May 2018 11:24:00 +0000 (07:24 -0400)
This condition as already tested before this code is called.

Lib/dataclasses.py

index 480c6f74165bbc93a94507590e15c9582bfbbad8..bb77d3b4052b2250cead4f2cb0abe1908454c173 100644 (file)
@@ -544,12 +544,11 @@ def _hash_fn(fields):
 
 
 def _is_classvar(a_type, typing):
-    if typing:
-        # This test uses a typing internal class, but it's the best
-        # way to test if this is a ClassVar.
-        return (a_type is typing.ClassVar
-                or (type(a_type) is typing._GenericAlias
-                    and a_type.__origin__ is typing.ClassVar))
+    # This test uses a typing internal class, but it's the best way to
+    # test if this is a ClassVar.
+    return (a_type is typing.ClassVar
+            or (type(a_type) is typing._GenericAlias
+                and a_type.__origin__ is typing.ClassVar))
 
 
 def _is_initvar(a_type, dataclasses):