Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
202c99b2
Commit
202c99b2
authored
Apr 13, 2001
by
Ka-Ping Yee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicate type objects from isroutine() and isbuiltin().
Make getmodule() on a module return the module itself.
parent
88ad12af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Lib/inspect.py
Lib/inspect.py
+4
-4
No files found.
Lib/inspect.py
View file @
202c99b2
...
...
@@ -123,14 +123,12 @@ def isbuiltin(object):
__doc__ documentation string
__name__ original name of this function or method
__self__ instance to which a method is bound, or None"""
return
type
(
object
)
in
[
types
.
BuiltinFunctionType
,
types
.
BuiltinMethodType
]
return
type
(
object
)
is
types
.
BuiltinFunctionType
def
isroutine
(
object
):
"""Return true if the object is any kind of function or method."""
return
type
(
object
)
in
[
types
.
FunctionType
,
types
.
LambdaType
,
types
.
MethodType
,
types
.
BuiltinFunctionType
,
types
.
BuiltinMethodType
]
types
.
MethodType
,
types
.
BuiltinFunctionType
]
def
getmembers
(
object
,
predicate
=
None
):
"""Return all members of an object as (name, value) pairs sorted by name.
...
...
@@ -231,6 +229,8 @@ modulesbyfile = {}
def
getmodule
(
object
):
"""Return the module an object was defined in, or None if not found."""
if
ismodule
(
object
):
return
object
if
isclass
(
object
):
return
sys
.
modules
.
get
(
object
.
__module__
)
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment