diff options
author | Eric V. Smith <ericvsmith@users.noreply.github.com> | 2018-05-16 11:24:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-16 11:24:00 (GMT) |
commit | 9285835a05ad0319acef111340266c0f85ed549c (patch) | |
tree | 7949303eab7b63b85e9ba03440dc995adec5cf96 | |
parent | f8e7549490d61c92b34bf2de3e03ba2f7b0ac6e1 (diff) | |
download | cpython-9285835a05ad0319acef111340266c0f85ed549c.zip cpython-9285835a05ad0319acef111340266c0f85ed549c.tar.gz cpython-9285835a05ad0319acef111340266c0f85ed549c.tar.bz2 |
bpo-33534: Remove unneeded test. (GH-6897)
This condition as already tested before this code is called.
-rw-r--r-- | Lib/dataclasses.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index 480c6f7..bb77d3b 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -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): |