Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 100 additions & 1 deletion Lib/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,106 @@

__author__ = ('Ka-Ping Yee <ping@lfw.org>',
'Yury Selivanov <yselivanov@sprymix.com>')


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was some invisible spaces here. I think this is not expected.

__all__ = [
"ArgInfo",
"Arguments",
"Attribute",
"BlockFinder",
"BoundArguments",
"CORO_CLOSED",
"CORO_CREATED",
"CORO_RUNNING",
"CORO_SUSPENDED",
"CO_ASYNC_GENERATOR",
"CO_COROUTINE",
"CO_GENERATOR",
"CO_ITERABLE_COROUTINE",
"CO_NESTED",
"CO_NEWLOCALS",
"CO_NOFREE",
"CO_OPTIMIZED",
"CO_VARARGS",
"CO_VARKEYWORDS",
"ClassFoundException",
"ClosureVars",
"EndOfBlock",
"FrameInfo",
"FullArgSpec",
"GEN_CLOSED",
"GEN_CREATED",
"GEN_RUNNING",
"GEN_SUSPENDED",
"Parameter",
"Signature",
"TPFLAGS_IS_ABSTRACT",
"Traceback",
"classify_class_attrs",
"cleandoc",
"currentframe",
"findsource",
"formatannotation",
"formatannotationrelativeto",
"formatargvalues",
"get_annotations",
"getabsfile",
"getargs",
"getargvalues",
"getattr_static",
"getblock",
"getcallargs",
"getclasstree",
"getclosurevars",
"getcomments",
"getcoroutinelocals",
"getcoroutinestate",
"getdoc",
"getfile",
"getframeinfo",
"getfullargspec",
"getgeneratorlocals",
"getgeneratorstate",
"getinnerframes",
"getlineno",
"getmembers",
"getmembers_static",
"getmodule",
"getmodulename",
"getmro",
"getouterframes",
"getsource",
"getsourcefile",
"getsourcelines",
"indentsize",
"isabstract",
"isasyncgen",
"isasyncgenfunction",
"isawaitable",
"isbuiltin",
"isclass",
"iscode",
"iscoroutine",
"iscoroutinefunction",
"isdatadescriptor",
"isframe",
"isfunction",
"isgenerator",
"isgeneratorfunction",
"isgetsetdescriptor",
"ismemberdescriptor",
"ismethod",
"ismethoddescriptor",
"ismodule",
"isroutine",
"istraceback",
"signature",
"stack",
"trace",
"unwrap",
"walktree",
]


import abc
import ast
import dis
Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def istest(self, predicate, exp):
continue
self.assertFalse(other(obj), 'not %s(%s)' % (other.__name__, exp))

def test__all__(self):
support.check__all__(self, inspect, not_exported=("k", "v", "mod_dict", "modulesbyfile"))

Comment thread
kumaraditya303 marked this conversation as resolved.
Outdated
def generator_function_example(self):
for i in range(2):
yield i
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add :attr:`__all__` to :mod:`inspect`, patch by Kumar Aditya.