aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* bpo-33594: Add deprecation info in inspect.py module (GH-7036)Miss Islington (bot)2018-10-191-7/+15
| | | | | (cherry picked from commit ded87d804e2a85b2a3ea9e7a11384b41fafdfa29) Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
* bpo-34871: inspect: Don't pollute sys.modules (GH-9696) (GH-9702)Miss Islington (bot)2018-10-041-1/+1
| | | | | | https://bugs.python.org/issue34871 (cherry picked from commit 6f85b826b527e240551613aeec3118a5469e3a33) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks ↵Miss Islington (bot)2018-08-241-1/+6
| | | | | | | (GH-8864) (cherry picked from commit 91cb298f811961277fd4cc4a32211899d48bedcb) Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
* bpo-33197: Update a error message of invalid inspect.Parameters. (GH-6636) ↵Miss Islington (bot)2018-05-291-16/+31
| | | | | | | (#7205) (cherry picked from commit a9cab433bbf02f3a1de59d14dc8f583181ffe2d5) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-33009: Fix inspect.signature() for single-parameter partialmethods. ↵Miss Islington (bot)2018-03-061-1/+2
| | | | | | | (GH-6004) (cherry picked from commit 8a387219bdfb6ee34928d6168ac42ca559f11c9a) Co-authored-by: Yury Selivanov <yury@magic.io>
* [3.6] bpo-25532: Protect against infinite loops in inspect.unwrap() ↵Serhiy Storchaka2017-09-271-3/+6
| | | | | | | | | | | | (GH-1717) (#3778) Some objects (like test mocks) auto-generate new objects on attribute access, which can lead to an infinite loop in inspect.unwrap(). Ensuring references are retained to otherwise temporary objects and capping the size of the memo dict turns this case into a conventional exception instead.. (cherry picked from commit f9169ce6b48c7cc7cc62d9eb5e4ee1ac7066d14b)
* bpo-30149: Fix partialmethod without explicit self parameter (#1308) (#1662)Dong-hee Na2017-06-151-4/+9
|
* [3.6] bpo-29822: make inspect.isabstract() work during __init_subclass__ (#1979)Nate2017-06-071-1/+22
| | | | | | | | At the time when an abstract base class' __init_subclass__ runs, ABCMeta.__new__ has not yet finished running, so in the presence of __init_subclass__, inspect.isabstract() can no longer depend only on TPFLAGS_IS_ABSTRACT. (cherry picked from commit fcfe80ec2592fed8b3941c79056a8737abef7d3b)
* bpo-26985: Add missing info of code object in inspect documentation ↵Xiang Zhang2017-04-131-12/+18
| | | | (GH-1090) (GH-1099)
* Issue #15812: Merge from 3.5Berker Peksag2017-01-031-1/+0
|\
| * Issue #15812: Delete redundant max(start, 0)Berker Peksag2017-01-031-1/+0
| | | | | | | | Noticed by Serhiy Storchaka.
* | Issue #15812: Merge from 3.5Berker Peksag2017-01-021-1/+1
|\|
| * Issue #15812: inspect.getframeinfo() now correctly shows the first line of a ↵Berker Peksag2017-01-021-1/+1
| | | | | | | | | | | | context Patch by Sam Breese.
* | Issue #27172: Undeprecate inspect.getfullargspec()Nick Coghlan2016-12-021-17/+25
| | | | | | | | | | | | This is still useful for single source Python 2/3 code migrating away from inspect.getargspec(), but that wasn't clear with the documented deprecation in place.
* | Merge 3.5 (issue #28639)Yury Selivanov2016-11-081-2/+2
|\|
| * Issue #28639: Fix inspect.isawaitable to always return boolYury Selivanov2016-11-081-2/+2
| | | | | | | | Patch by Justin Mayfield.
* | docs/inspect: clarify iscoroutinefunction; add docs for isasyncgen*Yury Selivanov2016-11-081-2/+7
| |
* | Issue #27989: Tweak inspect.formatannotation() to improve pydoc rendering of ↵Guido van Rossum2016-10-221-0/+2
|\| | | | | | | function annotations. Ivan L. (3.5->3.6)
| * Issue #27989: Tweak inspect.formatannotation() to improve pydoc rendering of ↵Guido van Rossum2016-10-221-0/+2
| | | | | | | | function annotations. Ivan L.
* | Issue #28003: Implement PEP 525 -- Asynchronous Generators.Yury Selivanov2016-09-081-0/+7
| |
* | Issue #27993: Merge plural fixes from 3.5Martin Panter2016-09-071-3/+2
|\|
| * Issue #27993: Fix problems with plural objects in docs and commentsMartin Panter2016-09-071-3/+2
| |
* | Issue #19611: handle implicit parameters in inspect.signatureNick Coghlan2016-06-041-0/+14
| | | | | | | | | | | | | | | | inspect.signature now reports the implicit ``.0`` parameters generated by the compiler for comprehension and generator expression scopes as if they were positional-only parameters called ``implicit0``. Patch by Jelle Zijlstra.
* | Merge 3.5 (issue #26347)Yury Selivanov2016-03-021-2/+0
|\|
| * inspect: Fix BoundArguments.apply_defaults to handle empty argumentsYury Selivanov2016-03-021-2/+0
| | | | | | | | Patch by Frederick Wagner (issue #26347)
* | Issue #25486: Resurrect inspect.getargspec in 3.6. Backout a565aad5d6e1.Yury Selivanov2016-01-111-0/+25
| | | | | | | | | | The decision is that we shouldn't remove popular APIs (however long they are depreacted) from Python 3, while 2.7 is still around and supported.
* | Issue #25503: Fixed inspect.getdoc() for inherited docstrings of properties.Serhiy Storchaka2015-10-291-6/+7
|\| | | | | | | Original patch by John Mark Vandenberg.
| * Issue #25503: Fixed inspect.getdoc() for inherited docstrings of properties.Serhiy Storchaka2015-10-291-6/+7
| | | | | | | | Original patch by John Mark Vandenberg.
* | Issue #13248: Delete remaining references of inspect.getargspec().Berker Peksag2015-07-311-5/+2
| | | | | | | | Noticed by Yaroslav Halchenko.
* | Issue #24485: Function source inspection fails on closures.Meador Inge2015-07-231-4/+22
|\| | | | | | | | | | | | | | | | | | | | | | | The fix for Issue #21217 introduced a regression that caused `inspect.getsource` to return incorrect results on nested functions. The root cause of the regression was due to switching the implementation to analyze the underlying bytecode instead of the source code. This commit switches things back to analyzing the source code in a more complete way. The original bug and the regression are both fixed by the new source code analysis.
| * Issue #24485: Function source inspection fails on closures.Meador Inge2015-07-231-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | The fix for Issue #21217 introduced a regression that caused `inspect.getsource` to return incorrect results on nested functions. The root cause of the regression was due to switching the implementation to analyze the underlying bytecode instead of the source code. This commit switches things back to analyzing the source code in a more complete way. The original bug and the regression are both fixed by the new source code analysis.
* | Issue #13248: Remove inspect.getmoduleinfo() from 3.6 (deprecated in 3.3)Yury Selivanov2015-07-231-17/+0
| |
* | Issue #13248: Remove inspect.getargspec from 3.6 (deprecated from 3.0)Yury Selivanov2015-07-231-25/+0
|/
* Issue #24485: Revert backwards compatibility breaking changes of #21217.Yury Selivanov2015-07-231-18/+2
|
* Issue #24669: Fix inspect.getsource() for 'async def' functions.Yury Selivanov2015-07-211-1/+1
| | | | Patch by Kai Groner.
* Issue #24206: Fixed __eq__ and __ne__ methods of inspect classes.Serhiy Storchaka2015-07-181-22/+19
|\
| * Issue #24206: Fixed __eq__ and __ne__ methods of inspect classes.Serhiy Storchaka2015-07-181-16/+10
| |
* | Issue #24400: Resurrect inspect.isawaitable()Yury Selivanov2015-07-031-0/+7
| | | | | | | | | | | | | | | | collections.abc.Awaitable and collections.abc.Coroutine no longer use __instancecheck__ hook to detect generator-based coroutines. inspect.isawaitable() can be used to detect generator-based coroutines and to distinguish them from regular generator objects.
* | Issue #24400: Remove inspect.isawaitable().Yury Selivanov2015-06-301-4/+0
| | | | | | | | | | | | isawaitable() was added before collections.abc.Awaitable; now, with Awaitable, it is no longer needed (we don't have ishashable() or isiterable() methods in the inspect module either).
* | Issue #24400: Introduce a distinct type for 'async def' coroutines.Yury Selivanov2015-06-221-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary of changes: 1. Coroutines now have a distinct, separate from generators type at the C level: PyGen_Type, and a new typedef PyCoroObject. PyCoroObject shares the initial segment of struct layout with PyGenObject, making it possible to reuse existing generators machinery. The new type is exposed as 'types.CoroutineType'. As a consequence of having a new type, CO_GENERATOR flag is no longer applied to coroutines. 2. Having a separate type for coroutines made it possible to add an __await__ method to the type. Although it is not used by the interpreter (see details on that below), it makes coroutines naturally (without using __instancecheck__) conform to collections.abc.Coroutine and collections.abc.Awaitable ABCs. [The __instancecheck__ is still used for generator-based coroutines, as we don't want to add __await__ for generators.] 3. Add new opcode: GET_YIELD_FROM_ITER. The opcode is needed to allow passing native coroutines to the YIELD_FROM opcode. Before this change, 'yield from o' expression was compiled to: (o) GET_ITER LOAD_CONST YIELD_FROM Now, we use GET_YIELD_FROM_ITER instead of GET_ITER. The reason for adding a new opcode is that GET_ITER is used in some contexts (such as 'for .. in' loops) where passing a coroutine object is invalid. 4. Add two new introspection functions to the inspec module: getcoroutinestate(c) and getcoroutinelocals(c). 5. inspect.iscoroutine(o) is updated to test if 'o' is a native coroutine object. Before this commit it used abc.Coroutine, and it was requested to update inspect.isgenerator(o) to use abc.Generator; it was decided, however, that inspect functions should really be tailored for checking for native types. 6. sys.set_coroutine_wrapper(w) API is updated to work with only native coroutines. Since types.coroutine decorator supports any type of callables now, it would be confusing that it does not work for all types of coroutines. 7. Exceptions logic in generators C implementation was updated to raise clearer messages for coroutines: Before: TypeError("generator raised StopIteration") After: TypeError("coroutine raised StopIteration")
* | Issue #23934: Fix inspect.signature to fail correctly for builtin types.Yury Selivanov2015-05-301-1/+5
| | | | | | | | Initial patch by James Powell.
* | Issue 24298: Fix signature() to properly unwrap wrappers around bound methodsYury Selivanov2015-05-271-0/+9
|\|
| * Issue 24298: Fix signature() to properly unwrap wrappers around bound methodsYury Selivanov2015-05-271-0/+8
| |
* | Issue 20438: Adjust stacklevel of inspect.getargspec() warning.Yury Selivanov2015-05-221-1/+2
| |
* | Issue 20438: Deprecate inspect.getargspec() and friends.Yury Selivanov2015-05-221-1/+4
| |
* | Set stacklevel to 2 to get more accurate warning messages from deprecated ↵Berker Peksag2015-05-211-2/+4
| | | | | | | | functions.
* | Issue 23898: Fix inspect.classify_class_attrs() to work with __eq__Yury Selivanov2015-05-211-3/+3
|\| | | | | | | Patch by Mike Bayer.
| * Issue 23898: Fix inspect.classify_class_attrs() to work with __eq__Yury Selivanov2015-05-211-3/+3
| |
| * inspect: Fix getsource() to load updated source of reloaded moduleYury Selivanov2014-12-081-5/+11
| | | | | | | | Issue #1218234. Initial patch by Berker Peksag.
* | Issue 24017: Use abc.Coroutine in inspect.iscoroutine() functionYury Selivanov2015-05-211-2/+1
| |