| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Methods (functions defined in class scope) are likely to be cleaned
up by the GC anyway.
Add a new code flag, `CO_METHOD`, that is set for functions defined
in a class scope. Use that when deciding to defer functions.
|
|
|
|
| |
parameters in inspect.Signature (GH-127657)
|
|
|
|
| |
LOAD_GLOBAL (#120143)
|
| |
|
|
|
|
|
| |
---------
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
|
|
|
| |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
| |
This is an alternative to GH-100168.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
classes (GH-123001)
Look up __firstlineno__ only in the class' dict, without searching in
base classes.
|
| |
|
|
|
|
|
|
| |
`isframe`, `iscode`. (#122059)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
| |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
`inspect.get_annotations` (#120270)
|
| |
|
|
|
|
| |
(#120214)
|
|
|
|
| |
with **kwargs (GH-103404)
|
|
|
|
| |
It is set by compiler with the line number of the first line of
the class definition.
|
|
|
|
|
|
|
|
|
| |
(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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
descriptor (GH-115540)
This also fixes inspect.Signature.from_callable() for builtins classmethod()
and staticmethod().
|
|
|
|
|
| |
Useful for introspection and consistent with functions and other
descriptors.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
| |
(#112631)
|
|
|
| |
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
definitions (#106815)
|
|
|
| |
Co-authored-by: Éric <merwok@netwok.org>
|
| |
|
|
|
|
| |
iteratively (#105070)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
| |
Co-authored-by: Carl Meyer <carl@oddbird.net>
|
|
|
|
|
| |
`inspect.getattr_static` (#104267)
Co-authored-by: Carl Meyer <carl@oddbird.net>
|
|
|
| |
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
| |
modules (#104032)
|
|
|
|
| |
after pos-only with default (#103557)
|
|
|
| |
Improve performance of `inspect.getattr_static`
|
|
|
|
| |
(#103318)
|
|
|
|
| |
(#103195)
|
|
|
|
| |
module (#11590)
|
| |
|