Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | gh-127610: Added validation for more than one var-positional and var-keyword ↵ | Apostol Fet | 2024-12-08 | 1 | -0/+8 |
| | | | | parameters in inspect.Signature (GH-127657) | ||||
* | gh-70764: inspect.getclosurevars now identifies global variables with ↵ | blhsing | 2024-11-05 | 1 | -5/+9 |
| | | | | LOAD_GLOBAL (#120143) | ||||
* | gh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101) | Xuanteng Huang | 2024-10-30 | 1 | -0/+2 |
| | |||||
* | gh-125633: Add function `ispackage` to stdlib `inspect` (#125634) | Zhikang Yan | 2024-10-27 | 1 | -3/+8 |
| | | | | | --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> | ||||
* | gh-101552: Allow pydoc to display signatures in source format (#124669) | Jelle Zijlstra | 2024-10-09 | 1 | -15/+37 |
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-116110: remove extra processing for the __signature__ attribute (GH-116234) | Sergey B Kirpichev | 2024-10-08 | 1 | -9/+1 |
| | | | This is an alternative to GH-100168. | ||||
* | gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in ↵ | Serhiy Storchaka | 2024-09-28 | 1 | -2/+4 |
| | | | | | | | | | | | | | classes (GH-123613) * Setting the __module__ attribute for a class now removes the __firstlineno__ item from the type's dict. * The _collections_abc and _pydecimal modules now completely replace the collections.abc and decimal modules after importing them. This allows to get the source of classes and functions defined in these modules. * inspect.findsource() now checks whether the first line number for a class is out of bound. | ||||
* | gh-119127: functools.partial placeholders (gh-119827) | dgpb | 2024-09-26 | 1 | -2/+22 |
| | |||||
* | gh-122981: Fix inspect.getsource() for generated classes with Python base ↵ | Serhiy Storchaka | 2024-08-20 | 1 | -3/+3 |
| | | | | | | classes (GH-123001) Look up __firstlineno__ only in the class' dict, without searching in base classes. | ||||
* | gh-119180: annotationlib: Fix __all__, formatting (#122365) | Jelle Zijlstra | 2024-08-11 | 1 | -3/+1 |
| | |||||
* | gh-122058: `Lib/inspect`: Update docstrings for `isfunction`, `isgenerator`, ↵ | Kirill Podoprigora | 2024-08-06 | 1 | -9/+24 |
| | | | | | | `isframe`, `iscode`. (#122059) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org> | ||||
* | gh-119180: Add `annotationlib` module to support PEP 649 (#119891) | Jelle Zijlstra | 2024-07-23 | 1 | -115/+1 |
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-121027: Add a future warning in functools.partial.__get__ (#121086) | Serhiy Storchaka | 2024-06-27 | 1 | -4/+4 |
| | |||||
* | gh-120381: Fix inspect.ismethoddescriptor() (#120383) | Jan Kaliszewski | 2024-06-18 | 1 | -4/+7 |
| | | | | | | | | The `inspect.ismethoddescriptor()` function did not check for the lack of `__delete__()` and, consequently, erroneously returned True when applied to *data* descriptors with only `__get__()` and `__delete__()` defined. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com> | ||||
* | gh-114053: Fix bad interaction of PEP 695, PEP 563 and ↵ | Alex Waygood | 2024-06-13 | 1 | -1/+7 |
| | | | | `inspect.get_annotations` (#120270) | ||||
* | gh-119180: PEP 649 compiler changes (#119361) | Jelle Zijlstra | 2024-06-11 | 1 | -7/+1 |
| | |||||
* | gh-120200: Fix `inspect.iscoroutinefunction(inspect) is True` corner case ↵ | Nikita Sobolev | 2024-06-07 | 1 | -3/+3 |
| | | | | (#120214) | ||||
* | gh-87106: Fix inspect.signature.bind() handling of positional-only arguments ↵ | Jacob Walls | 2024-05-13 | 1 | -12/+16 |
| | | | | with **kwargs (GH-103404) | ||||
* | gh-118465: Add __firstlineno__ attribute to class (GH-118475) | Serhiy Storchaka | 2024-05-06 | 1 | -78/+5 |
| | | | | It is set by compiler with the line number of the first line of the class definition. | ||||
* | gh-82062: Fix support of parameter defaults on methods in extension modules ↵ | Sergey B Kirpichev | 2024-05-02 | 1 | -0/+5 |
| | | | | | | | | | (GH-115270) Now inspect.signature() supports references to the module globals in parameter defaults on methods in extension modules. Previously it was only supported in functions. The workaround was to specify the fully qualified name, including the module name. | ||||
* | gh-118404: Fix inspect.signature() for non-comparable callables (GH-118405) | Serhiy Storchaka | 2024-04-30 | 1 | -2/+4 |
| | |||||
* | gh-118285: Fix signatures of operator.{attrgetter,itemgetter,methodcaller} ↵ | Serhiy Storchaka | 2024-04-29 | 1 | -0/+7 |
| | | | | | | | | | instances (GH-118316) * Allow to specify the signature of custom callable instances of extension type by the __text_signature__ attribute. * Specify signatures of operator.attrgetter, operator.itemgetter, and operator.methodcaller instances. | ||||
* | gh-118013: Use weakrefs for the cache key in `inspect._shadowed_dict` (#118202) | Alex Waygood | 2024-04-24 | 1 | -3/+22 |
| | |||||
* | gh-116987: Support class code objects in inspect.findsource() (GH-117025) | Tian Gao | 2024-03-21 | 1 | -9/+2 |
| | |||||
* | gh-114099 - Add iOS framework loading machinery. (GH-116454) | Russell Keith-Magee | 2024-03-19 | 1 | -1/+6 |
| | | | | Co-authored-by: Malcolm Smith <smith@chaquo.com> Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com> | ||||
* | gh-101293: Fix support of custom callables and types in ↵ | Serhiy Storchaka | 2024-03-01 | 1 | -87/+74 |
| | | | | | | | | | | | inspect.Signature.from_callable() (GH-115530) Support callables with the __call__() method and types with __new__() and __init__() methods set to class methods, static methods, bound methods, partial functions, and other types of methods and descriptors. Add tests for numerous types of callables and descriptors. | ||||
* | gh-112006: Fix inspect.unwrap() for types where __wrapped__ is a data ↵ | Serhiy Storchaka | 2024-02-26 | 1 | -7/+3 |
| | | | | | | descriptor (GH-115540) This also fixes inspect.Signature.from_callable() for builtins classmethod() and staticmethod(). | ||||
* | gh-101860: Expose __name__ on property (GH-101876) | Eugene Toder | 2024-02-20 | 1 | -3/+2 |
| | | | | | Useful for introspection and consistent with functions and other descriptors. | ||||
* | bpo-38364: unwrap partialmethods just like we unwrap partials (#16600) | Martijn Pieters | 2024-02-15 | 1 | -2/+4 |
| | | | | | | | | | | | | | * bpo-38364: unwrap partialmethods just like we unwrap partials The inspect.isgeneratorfunction, inspect.iscoroutinefunction and inspect.isasyncgenfunction already unwrap functools.partial objects, this patch adds support for partialmethod objects as well. Also: Rename _partialmethod to __partialmethod__. Since we're checking this attribute on arbitrary function-like objects, we should use the namespace reserved for core Python. --------- Co-authored-by: Petr Viktorin <encukou@gmail.com> | ||||
* | gh-112316: improve docs for `inspect.signature` and `inspect.Signature` ↵ | Alex Waygood | 2023-12-03 | 1 | -1/+1 |
| | | | | (#112631) | ||||
* | gh-112139: Add `inspect.Signature.format` and use it in `pydoc` (#112143) | Nikita Sobolev | 2023-12-02 | 1 | -0/+12 |
| | | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> | ||||
* | gh-108751: Add copy.replace() function (GH-108752) | Serhiy Storchaka | 2023-09-06 | 1 | -0/+4 |
| | | | | | | | | | It creates a modified copy of an object by calling the object's __replace__() method. It is a generalization of dataclasses.replace(), named tuple's _replace() method and replace() methods in various classes, and supports all these stdlib classes. | ||||
* | gh-106727: Add `__module__` check for `inspect.getsource(cls)` (#106968) | Tian Gao | 2023-07-24 | 1 | -1/+2 |
| | |||||
* | gh-106727: Make `inspect.getsource` smarter for class for same name ↵ | Tian Gao | 2023-07-18 | 1 | -11/+46 |
| | | | | definitions (#106815) | ||||
* | gh-81283: compiler: remove indent from docstring (#106411) | Inada Naoki | 2023-07-15 | 1 | -23/+22 |
| | | | Co-authored-by: Éric <merwok@netwok.org> | ||||
* | gh-105080: Fixed inconsistent signature on derived classes (#105217) | Tian Gao | 2023-06-02 | 1 | -11/+12 |
| | |||||
* | gh-105069: Add a readline-like callable to the tokenizer to consume input ↵ | Pablo Galindo Salgado | 2023-05-30 | 1 | -1/+1 |
| | | | | iteratively (#105070) | ||||
* | gh-105013: Fix inspect.getsource with parenthesized multiline lambdas (#105021) | Pablo Galindo Salgado | 2023-05-27 | 1 | -0/+8 |
| | |||||
* | gh-102856: Python tokenizer implementation for PEP 701 (#104323) | Marta Gómez Macías | 2023-05-21 | 1 | -2/+2 |
| | | | | | | | | | | | This commit replaces the Python implementation of the tokenize module with an implementation that reuses the real C tokenizer via a private extension module. The tokenize module now implements a compatibility layer that transforms tokens from the C tokenizer into Python tokenize tokens for backward compatibility. As the C tokenizer does not emit some tokens that the Python tokenizer provides (such as comments and non-semantic newlines), a new special mode has been added to the C tokenizer mode that currently is only used via the extension module that exposes it to the Python layer. This new mode forces the C tokenizer to emit these new extra tokens and add the appropriate metadata that is needed to match the old Python implementation. Co-authored-by: Pablo Galindo <pablogsal@gmail.com> | ||||
* | gh-75367: Fix data descriptor detection in inspect.getattr_static (#104517) | Furkan Onder | 2023-05-16 | 1 | -2/+4 |
| | | | Co-authored-by: Carl Meyer <carl@oddbird.net> | ||||
* | gh-103193: cache calls to `inspect._shadowed_dict` in ↵ | Alex Waygood | 2023-05-07 | 1 | -2/+6 |
| | | | | | `inspect.getattr_static` (#104267) Co-authored-by: Carl Meyer <carl@oddbird.net> | ||||
* | gh-102500: Implement PEP 688 (#102521) | Jelle Zijlstra | 2023-05-04 | 1 | -0/+23 |
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | ||||
* | gh-102799: replace sys.exc_info by sys.exception in inspect and traceback ↵ | Irit Katriel | 2023-05-01 | 1 | -1/+3 |
| | | | | modules (#104032) | ||||
* | gh-103556: [inspect.Signature] disallow pos-or-kw params without default ↵ | Nikita Sobolev | 2023-04-22 | 1 | -6/+4 |
| | | | | after pos-only with default (#103557) | ||||
* | gh-103193: Speedup and inline `inspect._is_type` (#103321) | Alex Waygood | 2023-04-06 | 1 | -9/+4 |
| | | | Improve performance of `inspect.getattr_static` | ||||
* | gh-103193: Use LBYL idioms rather than EAFP in `inspect.getattr_static` ↵ | Alex Waygood | 2023-04-06 | 1 | -15/+10 |
| | | | | (#103318) | ||||
* | gh-103193: Micro-optimise helper functions for `inspect.getattr_static` ↵ | Alex Waygood | 2023-04-05 | 1 | -4/+3 |
| | | | | (#103195) | ||||
* | gh-79940: add introspection API for asynchronous generators to `inspect` ↵ | Thomas Krennwallner | 2023-03-11 | 1 | -0/+50 |
| | | | | module (#11590) | ||||
* | gh-102378: don't bother stripping `/` from __text_signature__ (#102379) | David Hewitt | 2023-03-09 | 1 | -40/+17 |
| | |||||
* | gh-102302 Micro-optimize `inspect.Parameter.__hash__` (#102303) | Gouvernathor | 2023-03-04 | 1 | -1/+1 |
| |