diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2010-11-30 06:36:04 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2010-11-30 06:36:04 (GMT) |
commit | 7921b9f2104fee46413798d0a82a1e822f061957 (patch) | |
tree | aca8c35d47905f3f4b132aa69b137301ced387ea /Lib/inspect.py | |
parent | 234515afe594e5f9ca1b3f460735c68b04c031e2 (diff) | |
download | cpython-7921b9f2104fee46413798d0a82a1e822f061957.zip cpython-7921b9f2104fee46413798d0a82a1e822f061957.tar.gz cpython-7921b9f2104fee46413798d0a82a1e822f061957.tar.bz2 |
Issue 10220: switch to using string constants rather than integers for inspect.getgeneratorstate() return values and make debugging friendly str() and repr() for generator states a requirement in the test suite
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index e410dba..ed10ac5 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -1130,7 +1130,10 @@ def getattr_static(obj, attr, default=_sentinel): raise AttributeError(attr) -GEN_CREATED, GEN_RUNNING, GEN_SUSPENDED, GEN_CLOSED = range(4) +GEN_CREATED = 'GEN_CREATED' +GEN_RUNNING = 'GEN_RUNNING' +GEN_SUSPENDED = 'GEN_SUSPENDED' +GEN_CLOSED = 'GEN_CLOSED' def getgeneratorstate(generator): """Get current state of a generator-iterator. |