This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年01月23日 10:41 by christian.heimes, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| inspect.py.diff | gpolo, 2008年02月07日 19:01 | |||
| inspect_doc_and_test.patch | gpolo, 2008年02月07日 19:23 | |||
| inspect.py.diff | javimansilla, 2008年02月17日 16:24 | Typo fixed (ignore previous typo attachs) | ||
| test_inspect.py.diff | javimansilla, 2008年02月17日 16:25 | Better test coverage | ||
| Messages (11) | |||
|---|---|---|---|
| msg61577 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2008年01月23日 10:41 | |
The inspect module has no function isgenerator. |
|||
| msg62122 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2008年02月06日 19:47 | |
Is this wanted at all ? After checking http://www.python.org/dev/summary/2006-06-01_2006年06月15日/#inspect-isgenerator that points to: http://mail.python.org/pipermail/python-dev/2006-May/065334.html http://mail.python.org/pipermail/python-dev/2006-June/065508.html it seems a patch for this function would not be accepted. |
|||
| msg62156 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2008年02月07日 16:10 | |
I know two real usages: - the nose and py.test packages accept a generator function, as described here: http://codespeak.net/py/dist/test.html#generative-tests-yielding-more-tests http://somethingaboutorange.com/mrl/projects/nose/#test-generators. functions are collected with the help of the "inspect" module. - the twisted framework use "inlineCallbacks": a function executes an asynchronous operation and yields; execution is resumed when the operation gets its results. "inlineCallbacks" is actually a a decorator. Both cases make the difference between a generator function and a regular function, even if it returns a generator. And they don't want to execute the function to know it... |
|||
| msg62163 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2008年02月07日 18:25 | |
Maybe there should be two new functions then ? isgeneratorfunction and isgenerator. |
|||
| msg62169 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2008年02月07日 19:01 | |
I'm attaching a patch, it adds two new functions and removes some constants defined in the code that can be retrieved from compiler.consts |
|||
| msg62172 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2008年02月07日 19:23 | |
Adding a patch that fixes inspect test and doc. |
|||
| msg62492 - (view) | Author: Javier Mansilla (javimansilla) * | Date: 2008年02月17日 16:09 | |
I merged my working copy with your patches and they look fine. I fixed a
typo on the method doc ("is" instead of "i") so I'm attaching my
inspect.py.diff patch
|
|||
| msg62493 - (view) | Author: Javier Mansilla (javimansilla) * | Date: 2008年02月17日 16:18 | |
Sorry, I attached the wrong file The previous post saying "fixing typo" should attached inspect.py.diff. This is the one. |
|||
| msg62495 - (view) | Author: Javier Mansilla (javimansilla) * | Date: 2008年02月17日 16:24 | |
My dear, what is wrong with my browser (or with me). Now, yes, the one with the typo. |
|||
| msg62496 - (view) | Author: Javier Mansilla (javimansilla) * | Date: 2008年02月17日 16:25 | |
And now I'm attaching a new patch test_inspect.py.diff with a more complete test coverage. You didn't add isgenerator nor isgeneratorfunction tests. I did. |
|||
| msg62516 - (view) | Author: Facundo Batista (facundobatista) * (Python committer) | Date: 2008年02月18日 03:44 | |
Fixed in r60884. Thank you all very much! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:30 | admin | set | github: 46211 |
| 2008年02月18日 03:44:56 | facundobatista | set | status: open -> closed resolution: fixed messages: + msg62516 nosy: + facundobatista |
| 2008年02月17日 18:19:58 | facundobatista | set | files: - test_inspect.py.diff |
| 2008年02月17日 18:13:58 | facundobatista | set | files: - test_inspect.py.diff |
| 2008年02月17日 16:25:58 | javimansilla | set | files:
+ test_inspect.py.diff messages: + msg62496 |
| 2008年02月17日 16:24:37 | javimansilla | set | files:
+ inspect.py.diff messages: + msg62495 |
| 2008年02月17日 16:18:08 | javimansilla | set | files:
+ test_inspect.py.diff messages: + msg62493 |
| 2008年02月17日 16:09:45 | javimansilla | set | files:
+ test_inspect.py.diff nosy: + javimansilla messages: + msg62492 |
| 2008年02月07日 19:23:22 | gpolo | set | files:
+ inspect_doc_and_test.patch messages: + msg62172 |
| 2008年02月07日 19:01:29 | gpolo | set | files:
+ inspect.py.diff messages: + msg62169 |
| 2008年02月07日 18:25:46 | gpolo | set | messages: + msg62163 |
| 2008年02月07日 16:10:48 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc messages: + msg62156 |
| 2008年02月06日 19:47:02 | gpolo | set | nosy:
+ gpolo messages: + msg62122 |
| 2008年01月23日 10:41:30 | christian.heimes | create | |