summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
| |
* | Issue #17177: The imp module is pending deprecation.Brett Cannon2013-06-161-1/+3
| | | | | | | | | | | | To make sure there is no issue with code that is both Python 2 and 3 compatible, there are no plans to remove the module any sooner than Python 4 (unless the community moves to Python 3 solidly before then).
* | Issue #18200: Update the stdlib (except tests) to useBrett Cannon2013-06-141-1/+1
| | | | | | | | ModuleNotFoundError.
* | #17115,17116: Have modules initialize the __package__ and __loader__Brett Cannon2013-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attributes to None. The long-term goal is for people to be able to rely on these attributes existing and checking for None to see if they have been set. Since import itself sets these attributes when a loader does not the only instances when the attributes are None are from someone overloading __import__() and not using a loader or someone creating a module from scratch. This patch also unifies module initialization. Before you could have different attributes with default values depending on how the module object was created. Now the only way to not get the same default set of attributes is to circumvent initialization by calling ModuleType.__new__() directly.
* | #17526: merge with 3.3.Ezio Melotti2013-03-301-1/+1
|\ \ | |/
| * #17526: fix an IndexError raised while passing code without filename to ↵Ezio Melotti2013-03-301-1/+1
| | | | | | | | inspect.findsource(). Initial patch by Tyler Doyle.
* | Issue #17071: Signature.bind() now works when one of the keyword arguments ↵Antoine Pitrou2013-01-291-4/+4
|\ \ | |/ | | | | is named self.
| * Issue #17071: Signature.bind() now works when one of the keyword arguments ↵Antoine Pitrou2013-01-291-4/+4
| | | | | | | | is named ``self``.
* | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-10/+10
|/
* Issue #15401: Fix typo in inspect.getclosurevars docstring.Meador Inge2012-07-201-1/+1
|
* Close #15387: inspect.getmodulename() now uses a new ↵Nick Coghlan2012-07-181-2/+9
| | | | importlib.machinery.all_suffixes() API rather than the deprecated inspect.getmoduleinfo()
* Close #15153: Added inspect.getgeneratorlocals to simplify whitebox testing ↵Nick Coghlan2012-06-231-0/+18
| | | | of generator state updates
* Close #13062: Add inspect.getclosurevars to simplify testing stateful closuresNick Coghlan2012-06-231-0/+54
|
* Issue #15008: Implement PEP 362 "Signature Objects".Larry Hastings2012-06-221-3/+772
| | | | Patch by Yury Selivanov.
* Issue #14987: Add a missing import statementBrett Cannon2012-06-031-0/+1
|
* Issue #13959: Deprecate imp.get_suffixes() for new attributes onBrett Cannon2012-05-111-11/+16
| | | | | | | | | | | importlib.machinery that provide the suffix details for import. The attributes were not put on imp so as to compartmentalize everything importlib needs for setting up imports in importlib.machinery. This also led to an indirect deprecation of inspect.getmoduleinfo() as it directly returned imp.get_suffix's returned tuple which no longer makes sense.
* MergeMichael Foord2011-12-221-4/+5
|\
| * Metaclasses with metaclasses with a __dict__ descriptor can no longer ↵Michael Foord2011-12-221-4/+5
| | | | | | | | | | | | trigger code execution with inspect.getattr_static. Closes issue 11829.
* | Issue #1785: Fix inspect and pydoc with misbehaving descriptors.Antoine Pitrou2011-12-211-33/+46
|\ \ | |/ | | | | Also fixes issue #13581: `help(type)` wouldn't display anything.
| * Issue #1785: Fix inspect and pydoc with misbehaving descriptors.Antoine Pitrou2011-12-211-33/+46
| | | | | | | | Also fixes issue #13581: `help(type)` wouldn't display anything.
* | Merge 3.2Michael Foord2011-12-181-4/+6
|\ \ | |/
| * Fix inspect.getattr_static to work on modules (again).Michael Foord2011-12-181-4/+6
| | | | | | | | Closes issue 11813.
* | Merge 3.2Éric Araujo2011-11-291-1/+1
|\ \ | |/
| * Fix inspect.getmodule to use a copy of sys.modules for iteration (#13487).Éric Araujo2011-11-291-1/+1
| | | | | | | | | | | | This fixes a regression compared to 2.x, where sys.modules.items() returns a copy, as indicated by a comment in the source. Diagnosis and patch by Erik Tollerud.
* | remove unused imports (closes #12432)Benjamin Peterson2011-06-281-1/+0
| | | | | | | | A patch from Vincent Legoll.
* | give the names of missing positional or keyword-only arguments (closes #12356)Benjamin Peterson2011-06-241-12/+29
| |
* | merge 3.2 (#9284)Benjamin Peterson2011-06-111-2/+6
|\ \ | |/
| * allow "fake" filenames in findsource (closes #9284)Benjamin Peterson2011-06-111-2/+6
| | | | | | | | | | | | This allows findsource() to work in doctests. A patch from Dirkjan Ochtman.
* | greatly improve argument parsing error messages (closes #12265)Benjamin Peterson2011-06-061-50/+59
|/