Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(33956)

Delta Between Two Patch Sets: Lib/inspect.py

Issue 19611: inspect.getcallargs doesn't properly interpret set comprehension code objects.
Left Patch Set: Created 3 years, 4 months ago
Right Patch Set: Created 3 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Doc/library/inspect.rst ('k') | Lib/test/test_inspect.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 """Get useful information from live Python objects. 1 """Get useful information from live Python objects.
2 2
3 This module encapsulates the interface provided by the internal special 3 This module encapsulates the interface provided by the internal special
4 attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. 4 attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
5 It also provides some help for examining source code and class layout. 5 It also provides some help for examining source code and class layout.
6 6
7 Here are some of the useful functions provided by this module: 7 Here are some of the useful functions provided by this module:
8 8
9 ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(), 9 ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(),
10 isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(), 10 isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(),
(...skipping 2379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 self._default = default 2390 self._default = default
2391 self._annotation = annotation 2391 self._annotation = annotation
2392 2392
2393 if name is _empty: 2393 if name is _empty:
2394 raise ValueError('name is a required attribute for Parameter') 2394 raise ValueError('name is a required attribute for Parameter')
2395 2395
2396 if not isinstance(name, str): 2396 if not isinstance(name, str):
2397 raise TypeError("name must be a str, not a {!r}".format(name)) 2397 raise TypeError("name must be a str, not a {!r}".format(name))
2398 2398
2399 if name[0] == '.' and name[1:].isdigit(): 2399 if name[0] == '.' and name[1:].isdigit():
2400 # These are implicit arguments generated by comprehensions. In 2400 # These are implicit arguments generated by comprehensions. In
r.david.murray 2016/06/04 02:01:16 "These are arguments implicitly generated by the C
2401 # order to provide a friendlier interface to users, we recast 2401 # order to provide a friendlier interface to users, we recast
2402 # their name as "implicitN" and treat them as positional-only. 2402 # their name as "implicitN" and treat them as positional-only.
2403 # See issue 19611. 2403 # See issue 19611.
2404 if kind != _POSITIONAL_OR_KEYWORD: 2404 if kind != _POSITIONAL_OR_KEYWORD:
2405 raise ValueError( 2405 raise ValueError(
2406 'implicit arguments must be passed in as {}'.format( 2406 'implicit arguments must be passed in as {}'.format(
2407 _POSITIONAL_OR_KEYWORD 2407 _POSITIONAL_OR_KEYWORD
2408 ) 2408 )
2409 ) 2409 )
2410 self._kind = _POSITIONAL_ONLY 2410 self._kind = _POSITIONAL_ONLY
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
3034 else: 3034 else:
3035 print('Line: {}'.format(lineno)) 3035 print('Line: {}'.format(lineno))
3036 3036
3037 print('\n') 3037 print('\n')
3038 else: 3038 else:
3039 print(getsource(obj)) 3039 print(getsource(obj))
3040 3040
3041 3041
3042 if __name__ == "__main__": 3042 if __name__ == "__main__":
3043 _main() 3043 _main()
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+