| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
`inspect.signature` (GH-27177) (GH-27209)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 6aab5f9bf303a8e4cd8377fabcdcb499e0541f9a)
Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
|
|
|
|
| |
bugfix backports (#27193)
|
|
|
|
|
|
|
|
| |
range (GH-23633)
This can happen when a file was edited after it was imported.
(cherry picked from commit 2e0760bb2edb595050aff82f236cd32b44d3dfb3)
Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
|
|
|
|
|
| |
(cherry picked from commit 6e1eec71f59c344fb23c7977061dc2c97b77d51b)
Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#10307)
* Use ast module to find class definition
* Add NEWS entry
* Fix class with multiple children and move decorator code to the method
* Fix PR comments
1. Use node.decorator_list to select decorators
2. Remove unwanted variables in ClassVisitor
3. Simplify stack management as per review
* Add test for nested functions and async calls
* Fix pydoc test since comments are returned now correctly
* Set event loop policy as None to fix environment related change
* Refactor visit_AsyncFunctionDef and tests
* Refactor to use local variables and fix tests
* Add patch attribution
* Use self.addCleanup for asyncio
* Rename ClassVisitor to ClassFinder and fix asyncio cleanup
* Return first class inside conditional in case of multiple definitions. Remove decorator for class source.
* Add docstring to make the test correct
* Modify NEWS entry regarding decorators
* Return decorators too for bpo-15856
* Move ast and the class source code to top. Use proper Exception.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
(GH-18786)
`list(sys.modules.items())` was apparently not immune to "dictionary
changed size during iteration" errors.
Tested internally using an integration test that has run into this a couple of times in the past two years. With this patch applied, the test is no longer flaky.
|
| |
|
| |
|
| |
|
|
|
|
| |
positional-only parameter (GH-16800)
|
|
|
|
|
|
|
|
| |
https://bugs.python.org/issue34706
Specifically in the case of a class that does not override its
constructor signature inherited from object.
These are Buck Evan @bukzor's changes cherrypicked from GH-9344.
|
|
|
| |
Constants added by the site module like exit() "should not be used in programs"
|
|
|
|
|
| |
It should avoid dynamic lookup including `isinstance`.
This is a regression caused by GH-5351.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, inspect.getfile(str) will report nonsense:
```pytb
>>> inspect.getfile(str)
TypeError: <module 'builtins' (built-in)> is a built-in class
```
This fixes that
https://bugs.python.org/issue37173
|
|
|
|
| |
arguments in the code object (GH-13726)
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This is consistent with the rest of the `warnings.warn` usage in the
inspect.py module and aids identifying code that needs to be fixed.
This warning came in via d5d2b4546939b98244708e5bb0cfccd55b99d244
|
|
|
|
|
|
|
|
| |
regular args (GH-13016)
* bpo-36751: Deprecate getfullargspec and report positional-only args as regular args
* Use inspect.signature in testhelpers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit contains the implementation of PEP570: Python positional-only parameters.
* Update Grammar/Grammar with new typedarglist and varargslist
* Regenerate grammar files
* Update and regenerate AST related files
* Update code object
* Update marshal.c
* Update compiler and symtable
* Regenerate importlib files
* Update callable objects
* Implement positional-only args logic in ceval.c
* Regenerate frozen data
* Update standard library to account for positional-only args
* Add test file for positional-only args
* Update other test files to account for positional-only args
* Add News entry
* Update inspect module and related tests
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
isasyncgenfunction work with functools.partial (GH-9903)
inspect.isfunction() processes both inspect.isfunction(func) and
inspect.isfunction(partial(func, arg)) correctly but some other functions in the
inspect module (iscoroutinefunction, isgeneratorfunction and isasyncgenfunction)
lack this functionality. This commits adds a new check in the mentioned functions
in the inspect module so they can work correctly with arbitrarily nested partial
functions.
|
| |
|
|
|
| |
https://bugs.python.org/issue34871
|
| |
|
|
|
|
| |
(GH-8864)
|
|
|
|
| |
warning (GH-7655)
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
(GH-1959)
Look for '__set__' or '__delete__'.
|
|
|
|
| |
(GH-6004)
|
|
|
|
|
|
|
|
|
|
| |
namespace package (GH-5980)
* bpo-32991: Add test capturing expectation.
DocTestFinder.find should return an empty list for doctests in a namespace package.
* bpo-32991: Restore expectation that inspect.getfile on a namespace package raises TypeError.
|
|
|
|
| |
* use isinstance(..) instead of type(..)
* use '.. not in ..' instead of 'not .. in .. '
|
| |
|
|
|
|
| |
Add types.ClassMethodDescriptorType for unbound class methods.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
* Replaced list(<generator expression>) with list comprehension
* Replaced dict(<generator expression>) with dict comprehension
* Replaced set(<list literal>) with set literal
* Replaced builtin func(<list comprehension>) with func(<generator
expression>) when supported (e.g. any(), all(), tuple(), min(), &
max())
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\ |
|