diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-01-29 21:50:40 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-01-29 21:50:40 (GMT) |
commit | 89ca85c7465020b181e7e8a6109fc893675fdf7b (patch) | |
tree | 1f53711a4ba9e6185385f64d20c4420389dc7e61 | |
parent | 0486f819c93de81120ad75570df5d6837017c03d (diff) | |
download | cpython-89ca85c7465020b181e7e8a6109fc893675fdf7b.zip cpython-89ca85c7465020b181e7e8a6109fc893675fdf7b.tar.gz cpython-89ca85c7465020b181e7e8a6109fc893675fdf7b.tar.bz2 |
inspect.Signature.from_function: Use CO_VARARGS & CO_VARKEYWORDS constants
-rw-r--r-- | Lib/inspect.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 3ad4a82..e6c7b5b 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -2109,7 +2109,7 @@ class Signature: default=defaults[offset])) # *args - if func_code.co_flags & 0x04: + if func_code.co_flags & CO_VARARGS: name = arg_names[pos_count + keyword_only_count] annotation = annotations.get(name, _empty) parameters.append(Parameter(name, annotation=annotation, @@ -2126,9 +2126,9 @@ class Signature: kind=_KEYWORD_ONLY, default=default)) # **kwargs - if func_code.co_flags & 0x08: + if func_code.co_flags & CO_VARKEYWORDS: index = pos_count + keyword_only_count - if func_code.co_flags & 0x04: + if func_code.co_flags & CO_VARARGS: index += 1 name = arg_names[index] |