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 2009年01月17日 03:26 by terry.reedy, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg79999 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2009年01月17日 03:26 | |
inspect module in 3.0 .isclass: says "Return true if the object is a class." Since the issue of builtin versus Python coded is involved in all the other methods below, I would expand this to "Return true if the object is a class, whether built-in or Python-coded." to emphasize that this is not an issue for this one. .isfunction: current "Return true if the object is a Python function or unnamed (lambda) function." falsely implies that there is such a thing as 'unnamed (lambda) function; different from 'Python function'. By test, it just returns True for 'function' objects. Suggestion: "Return true for Python-coded functions, including unbound Python-coded methods." or possibly "Return true for functions created by def statements and lambda expressions, including unbound Python-coded methods. .ismethod: "Return true if the object is a method." should be specified to something like "Return true if the object is a bound method written in Python." .isbuiltin: says "Return true if the object is a built-in function." but actually tests for membership in class 'builtin_function_or_method'. I believe that truth is "Return true if the object is a built-in function (but not a class) or a bound built-in non-special method." It is True, for instance, for [].append but not [].__hash__. I am assuming that this behavior is intended and not a bug. .ismethoddescriptor: "Return true if the object is a method descriptor, but not if ismethod() or isclass() or isfunction() are true." begs the question of what a method descriptor is. I believe the following is both true and clearer. "Return true if the object is a built-in method and isbuiltin() is false. I would follow with "The methods isclass, isfunction, ismethod, isbuiltin, and ismethoddescriptor are mutually exclusive." I believe the following is true, and could be added also. "Exact one is true for any instance of a built-in callable class." |
|||
| msg109272 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010年07月04日 22:26 | |
Has this issue simply slipped under the radar? |
|||
| msg109968 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2010年07月11日 08:37 | |
No, I've just had no time to review the suggested changes. |
|||
| msg118802 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2010年10月15日 16:53 | |
Committed suggestions with a few changes in r85541. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:44 | admin | set | github: 49218 |
| 2010年10月15日 16:53:38 | georg.brandl | set | status: open -> closed resolution: fixed messages: + msg118802 |
| 2010年07月12日 00:09:00 | terry.reedy | set | versions: + Python 3.2, - Python 3.0 |
| 2010年07月11日 08:37:21 | georg.brandl | set | assignee: georg.brandl -> docs@python messages: + msg109968 nosy: + docs@python |
| 2010年07月04日 22:26:11 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg109272 |
| 2009年01月17日 03:26:08 | terry.reedy | create | |