summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #22186: Fix typos in Lib/.Berker Peksag2014-10-191-1/+1
| | | | Patch by Févry Thibault.
* inspect: Validate that __signature__ is None or an instance of Signature.Yury Selivanov2014-06-231-0/+4
| | | | Closes #21801.
* inspect.signautre: Fix functools.partial support. Issue #21117Yury Selivanov2014-04-081-73/+62
|
* inspect: Fix getcallargs() to fail correctly if more than 3 args are missing.Yury Selivanov2014-03-271-1/+1
| | | | Patch by Jeremiah Lowin. Closes #20817.
* inspect: Fix getcallargs() to raise correct TypeErrorYury Selivanov2014-03-271-1/+1
| | | | | ... for missing keyword-only arguments. Patch by Jeremiah Lowin. Closes #20816.
* inspect.signature: Check for function-like objects before builtins. Issue #17159Yury Selivanov2014-02-211-4/+4
|
* inspect: Fix getfullargspec to support builtin module-level functions. Issue ↵Yury Selivanov2014-02-211-2/+9
| | | | #20711
* inspect: Fix getfullargspec() to not to follow __wrapped__ chainsYury Selivanov2014-02-191-46/+65
| | | | Initial patch by Nick Coghlan.
* Issue #20530: Argument Clinic's signature format has been revised again.Larry Hastings2014-02-091-23/+92
| | | | | | | The new syntax is highly human readable while still preventing false positives. The syntax also extends Python syntax to denote "self" and positional-only parameters, allowing inspect.Signature objects to be totally accurate for all supported builtins in Python 3.4.
* inspect.signature: Add (restore) support for builtin classes #20473Yury Selivanov2014-02-031-131/+164
|
* inspect.signature: Use 'inspect.isbuiltin' in 'Signature.from_builtin'Yury Selivanov2014-02-021-1/+2
|
* inspect: Add some comments in Parameter.__eq__ methodYury Selivanov2014-01-311-0/+11
|
* inspect.Signauture.from_function: validate duck functions in Signature ↵Yury Selivanov2014-01-311-5/+11
| | | | constructor #17159
* inspect.signature: Support duck-types of Python functions (Cython, for ↵Yury Selivanov2014-01-311-2/+30
| | | | instance) #17159
* inspect.classify_class_attrs: Classify object.__new__ and __init__ correctly ↵Yury Selivanov2014-01-311-1/+1
| | | | #18801
* inspect.Signature.from_function: Use CO_VARARGS & CO_VARKEYWORDS constantsYury Selivanov2014-01-291-3/+3
|
* inspect.signature: Make sure that if a callable object has '_patialmethod'Yury Selivanov2014-01-291-11/+12
| | | | attribute, that attribute is an instance of 'functools.partialmethod'.
* inspect.Signature.bind: Update method signature to rule out possiblityYury Selivanov2014-01-291-4/+4
| | | | | of name conflict between '__bind_self' and actual keyword argument to 'bind' or 'bind_partial'.
* inspect: Rename private helper functionYury Selivanov2014-01-291-5/+5
|
* inspect.getfullargspec: Use inspect.signature API behind the scenes #17481Yury Selivanov2014-01-291-6/+105
|
* inspect.Signature: ensure that non-default params don't follow default ones ↵Yury Selivanov2014-01-291-1/+20
| | | | #20427
* inspect.signature: Add support for decorated (wrapped) builtins #20425Yury Selivanov2014-01-291-3/+3
|
* inspect.Signature: Make from_builtin to raise an exception if no signature canYury Selivanov2014-01-291-10/+20
| | | | be provided #20422
* inspect.Signature.bind: Add **kwargs/positional-only check backYury Selivanov2014-01-291-0/+8
|
* inspect.Signature.bind: Fix pos-only params with defaults; fix *args in ↵Yury Selivanov2014-01-281-8/+8
| | | | | | named args #19140 Initial patch by Yann Kaiser (epsy).
* inspect: Fix docstrings for Parameter & Signature classesYury Selivanov2014-01-281-3/+5
|
* inspect.signature: Handle bound methods with '(*args)' signature correctly ↵Yury Selivanov2014-01-281-5/+34
| | | | #20401
* Issue #20326: Argument Clinic now uses a simple, unique signature toLarry Hastings2014-01-281-12/+9
| | | | | | | | | | annotate text signatures in docstrings, resulting in fewer false positives. "self" parameters are also explicitly marked, allowing inspect.Signature() to authoritatively detect (and skip) said parameters. Issue #20326: Argument Clinic now generates separate checksums for the input and output sections of the block, allowing external tools to verify that the input has not changed (and thus the output is not out-of-date).
* inspect.signature: Support classes without user-defined __init__/__new__ #20308Yury Selivanov2014-01-281-0/+11
|
* inspect.signature: Add support for 'functools.partialmethod' #20223Yury Selivanov2014-01-271-40/+67
|
* inspect.signature: Use '/' to separate positional-only parameters fromYury Selivanov2014-01-271-23/+30
| | | | the rest in Signature.__str__. #20356
* inspect.getfile: Don't crash on classes without '__module__' attribute #20372Yury Selivanov2014-01-271-3/+4
| | | | | Some classes defined in C may not have the '__module__' attribute, so we now handle this case to avoid having unexepected AttributeError.
* Issue #20189: Four additional builtin types (PyTypeObject,Larry Hastings2014-01-241-5/+27
| | | | | | PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type) have been modified to provide introspection information for builtins. Also: many additional Lib, test suite, and Argument Clinic fixes.
* Issue #20226: Major improvements to Argument Clinic.Larry Hastings2014-01-161-37/+58
| | | | | | | | | | | | | | | | | | | | | | | * You may now specify an expression as the default value for a parameter! Example: "sys.maxsize - 1". This support is intentionally quite limited; you may only use values that can be represented as static C values. * Removed "doc_default", simplified support for "c_default" and "py_default". (I'm not sure we still even need "py_default", but I'm leaving it in for now in case a use presents itself.) * Parameter lines support a trailing '\\' as a line continuation character, allowing you to break up long lines. * The argument parsing code generated when supporting optional groups now uses PyTuple_GET_SIZE instead of PyTuple_GetSize, leading to a 850% speedup in parsing. (Just kidding, this is an unmeasurable difference.) * A bugfix for the recent regression where the generated prototype from pydoc for builtins would be littered with unreadable "=<object ...>"" default values for parameters that had no default value. * Converted some asserts into proper failure messages. * Many doc improvements and fixes.
* Issue #20144: Argument Clinic now supports simple constants as parameterLarry Hastings2014-01-071-7/+49
| | | | | default values. inspect.Signature correspondingly supports them in __text_signature__ fields for builtins.
* merge 3.3 (closes #20108)Benjamin Peterson2014-01-021-1/+3
|\
| * avoid parameter name clash (closes #20108)Benjamin Peterson2014-01-021-1/+3
| |
* | Issue #19674: inspect.signature() now produces a correct signatureLarry Hastings2013-11-231-0/+62
| | | | | | | | for some builtins.
* | Issue #19030: final pieces for proper location of various class attributes ↵Ethan Furman2013-10-211-23/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | located in the metaclass. Okay, hopefully the very last patch for this issue. :/ I realized when playing with Enum that the metaclass attributes weren't always displayed properly. New patch properly locates DynamicClassAttributes, virtual class attributes (returned by __getattr__ and friends), and metaclass class attributes (if they are also in the metaclass __dir__ method). Also had to change one line in pydoc to get this to work. Added tests in test_inspect and test_pydoc to cover these situations.
* | Issue #19030: special-cased __dict__ as the actual dict is not returned, a ↵Ethan Furman2013-10-181-0/+2
| | | | | | | | proxy is.
* | Close #19030: inspect.getmembers and inspect.classify_class_attrsEthan Furman2013-10-181-24/+33
| | | | | | | | | | | | | | | | | | | | Order of search is now: 1. Try getattr 2. If that throws an exception, check __dict__ directly 3. If still not found, walk the mro looking for the eldest class that has the attribute (e.g. things returned by __getattr__) 4. If none of that works (e.g. due to a buggy __dir__, __getattr__, etc. method or missing __slot__ attribute), ignore the attribute entirely.
* | Close #19030: improvements to inspect and Enum.Ethan Furman2013-09-251-29/+69
| | | | | | | | | | | | | | | | | | | | inspect.getmembers and inspect.classify_class_attrs now search the metaclass mro for types.DynamicClassAttributes (what use to be called enum._RouteClassAttributeToGetattr); in part this means that these two functions no longer rely solely on dir(). Besides now returning more accurate information, these improvements also allow a more helpful help() on Enum classes.
* | Close #18626: add a basic CLI for the inspect moduleNick Coghlan2013-09-221-0/+61
| |
* | Close #18929: inspect.classify_class_attrs will now search the metaclasses ↵Ethan Furman2013-09-151-1/+6
| | | | | | | | (last) to find where an attr was defined.
* | Issue #18830: inspect.getclasstree() no more produces duplicated entries evenSerhiy Storchaka2013-09-051-1/+2
|\ \ | |/ | | | | when input list contains duplicates.
| * Issue #18830: inspect.getclasstree() no more produces duplicated entries evenSerhiy Storchaka2013-09-051-1/+2
| | | | | | | | when input list contains duplicates.
* | #18705: merge with 3.3.Ezio Melotti2013-08-171-2/+2
|\ \ | |/
| * #18705: fix a number of typos. Patch by Févry Thibault.Ezio Melotti2013-08-171-2/+2
| |
* | Close #13266: Add inspect.unwrapNick Coghlan2013-07-281-7/+37
| | | | | | | | Initial patch by Daniel Urban and Aaron Iles
* | Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a)Brett Cannon2013-07-041-1/+1
| |