Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(57)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Unified Diff: Lib/inspect.py

Issue 6425052: Unbinding of methods
Patch Set: Created 13 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/functools.py ('k') | Lib/test/test_functools.py » ('j') | Objects/classobject.c » ('J')
('e') | ('c') | ('s')
Index: Lib/inspect.py
===================================================================
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -172,6 +172,27 @@
__kwdefaults__ dict of keyword only parameters with defaults"""
return isinstance(object, types.FunctionType)
+def isanyfunction(object):
+ """
+ Return true if the object is any kind of function (method, builtin etc.).
+ """
+ return type(object) in types.AllFunctionTypes
+
+def isanyboundfunction(object):
+ """
+ Return true if the object is any kind of bound function.
+
+ Class methods are considered bound functions. Static methods are not.
+ """
+ return isanyfunction(object) and hasattr(object, '__self__') and \
+ self is not None and type(self) is not types.ModuleType
+
+def isanyunboundfunction(object):
+ """
+ Return true if the object is any kind of unbound function.
+ """
+ return isanyfunction(object) and not isanyboundfunction(object)
+
def isgeneratorfunction(object):
"""Return true if the object is a user-defined generator function.
« no previous file with comments | « Lib/functools.py ('k') | Lib/test/test_functools.py » ('j') | Objects/classobject.c » ('J')
Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /