Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | gh-108303: Move all inspect test files to `test_inspect/` (#109607) | Nikita Sobolev | 2023-10-10 | 1 | -4964/+0 |
| | |||||
* | gh-109625: Move _ready_to_import() from test_import to support.import_helper ↵ | Nikita Sobolev | 2023-09-21 | 1 | -4/+2 |
| | | | | (#109626) | ||||
* | gh-108751: Add copy.replace() function (GH-108752) | Serhiy Storchaka | 2023-09-06 | 1 | -4/+61 |
| | | | | | | | | | 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-108638: Fix tests when _stat extension is missing (#108689) | Victor Stinner | 2023-08-31 | 1 | -6/+22 |
| | | | | Fix test_inspect and test_pydoc when the _stat extension is missing. Skip tests relying on _stat when _stat is missing. | ||||
* | gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (#108354) | Nikita Sobolev | 2023-08-23 | 1 | -1/+1 |
| | |||||
* | gh-84805: Autogenerate signature for METH_NOARGS and METH_O extension ↵ | Serhiy Storchaka | 2023-08-11 | 1 | -0/+77 |
| | | | | functions (GH-107794) | ||||
* | gh-107446: Fix test_inspect.test_class_with_method_from_other_module when ↵ | Tian Gao | 2023-08-03 | 1 | -0/+3 |
| | | | | | ran multiple times (#107451) Co-authored-by: Kumar Aditya <kumaraditya@python.org> | ||||
* | gh-106727: Add `__module__` check for `inspect.getsource(cls)` (#106968) | Tian Gao | 2023-07-24 | 1 | -0/+28 |
| | |||||
* | gh-106727: Make `inspect.getsource` smarter for class for same name ↵ | Tian Gao | 2023-07-18 | 1 | -1/+4 |
| | | | | definitions (#106815) | ||||
* | gh-81283: compiler: remove indent from docstring (#106411) | Inada Naoki | 2023-07-15 | 1 | -2/+33 |
| | | | Co-authored-by: Éric <merwok@netwok.org> | ||||
* | gh-105080: Fixed inconsistent signature on derived classes (#105217) | Tian Gao | 2023-06-02 | 1 | -0/+18 |
| | |||||
* | gh-105042: Disable unmatched parens syntax error in python tokenize (#105061) | Lysandros Nikolaou | 2023-05-30 | 1 | -1/+3 |
| | |||||
* | gh-105013: Fix inspect.getsource with parenthesized multiline lambdas (#105021) | Pablo Galindo Salgado | 2023-05-27 | 1 | -0/+16 |
| | |||||
* | gh-104955: Fix __release_buffer__ signature (#104956) | Jelle Zijlstra | 2023-05-26 | 1 | -0/+5 |
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | ||||
* | gh-75367: Fix data descriptor detection in inspect.getattr_static (#104517) | Furkan Onder | 2023-05-16 | 1 | -0/+3 |
| | | | Co-authored-by: Carl Meyer <carl@oddbird.net> | ||||
* | gh-97933: (PEP 709) inline list/dict/set comprehensions (#101441) | Carl Meyer | 2023-05-09 | 1 | -5/+5 |
| | | | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> | ||||
* | gh-103193: Improve `getattr_static` test coverage (#104286) | Alex Waygood | 2023-05-08 | 1 | -0/+29 |
| | |||||
* | gh-103193: cache calls to `inspect._shadowed_dict` in ↵ | Alex Waygood | 2023-05-07 | 1 | -0/+22 |
| | | | | | `inspect.getattr_static` (#104267) Co-authored-by: Carl Meyer <carl@oddbird.net> | ||||
* | gh-103556: [inspect.Signature] disallow pos-or-kw params without default ↵ | Nikita Sobolev | 2023-04-22 | 1 | -6/+34 |
| | | | | after pos-only with default (#103557) | ||||
* | gh-103553: Improve `test_inspect`: add more assertions, remove unused (#103554) | Nikita Sobolev | 2023-04-15 | 1 | -15/+9 |
| | |||||
* | gh-103406: Modernize pos-only arguments usage in `test_signature` (#103407) | Nikita Sobolev | 2023-04-14 | 1 | -20/+11 |
| | |||||
* | gh-102799: use exception instance instead of sys.exc_info() (#102885) | Irit Katriel | 2023-03-31 | 1 | -1/+1 |
| | |||||
* | gh-79940: skip `TestGetAsyncGenState` on wasm as it requires working sockets ↵ | Thomas Krennwallner | 2023-03-11 | 1 | -1/+3 |
| | | | | | | | | | (GH-102605) Skip `TestGetAsyncGenState` and restoring of the default event loop policy in `test_inspect` if platform lacks working socket support. Fixes #11590 Automerge-Triggered-By: GH:kumaraditya303 | ||||
* | gh-79940: add introspection API for asynchronous generators to `inspect` ↵ | Thomas Krennwallner | 2023-03-11 | 1 | -0/+107 |
| | | | | module (#11590) | ||||
* | gh-102378: don't bother stripping `/` from __text_signature__ (#102379) | David Hewitt | 2023-03-09 | 1 | -16/+7 |
| | |||||
* | gh-94912: Adjusted check for non-standard coroutine function marker. (#100935) | Carlton Gibson | 2023-01-11 | 1 | -0/+8 |
| | | | | | | The initial implementation did not correctly identify explicitly marked class instances. Follow up to 532aa4e4e019812d0388920768ede7c04232ebe1 | ||||
* | gh-96127: Fix `inspect.signature` call on mocks (#96335) | Nikita Sobolev | 2023-01-07 | 1 | -0/+19 |
| | |||||
* | gh-85267: Improvements to inspect.signature __text_signature__ handling (#98796) | Shantanu | 2022-12-21 | 1 | -1/+20 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes a couple related changes to inspect.signature's behaviour when parsing a signature from `__text_signature__`. First, `inspect.signature` is documented as only raising ValueError or TypeError. However, in some cases, we could raise RuntimeError. This PR changes that, thereby fixing #83685. (Note that the new ValueErrors in RewriteSymbolics are caught and then reraised with a message) Second, `inspect.signature` could randomly drop parameters that it didn't understand (corresponding to `return None` in the `p` function). This is the core issue in #85267. I think this is very surprising behaviour and it seems better to fail outright. Third, adding this new failure broke a couple tests. To fix them (and to e.g. allow `inspect.signature(select.epoll.register)` as in #85267), I add constant folding of a couple binary operations to RewriteSymbolics. (There's some discussion of making signature expression evaluation arbitrary powerful in #68155. I think that's out of scope. The additional constant folding here is pretty straightforward, useful, and not much of a slippery slope) Fourth, while #85267 is incorrect about the cause of the issue, it turns out if you had consecutive newlines in __text_signature__, you'd get `tokenize.TokenError`. Finally, the `if name is invalid:` code path was dead, since `parse_name` never returned `invalid`. | ||||
* | gh-94912: Added marker for non-standard coroutine function detection (#99247) | Carlton Gibson | 2022-12-18 | 1 | -0/+45 |
| | | | | | This introduces a new decorator `@inspect.markcoroutinefunction`, which, applied to a sync function, makes it appear async to `inspect.iscoroutinefunction()`. | ||||
* | gh-100039: enhance __signature__ to work with str and callables (GH-100168) | Ethan Furman | 2022-12-16 | 1 | -0/+32 |
| | | | | | Callables should be either class- or static-methods. Enum now uses the classmethod version to greatly improve the help given for enums and flags. | ||||
* | gh-83035: handle decorator with nested parens in inspect.getsource (#99654) | Carl Meyer | 2022-12-07 | 1 | -0/+6 |
| | |||||
* | gh-74044: inspect.signature for wrappers around decorated bound methods (GH-736) | Anton Ryzhov | 2022-11-10 | 1 | -2/+7 |
| | |||||
* | GH-83901: Improve Signature.bind error message for missing keyword-only ↵ | Frazer McLean | 2022-10-07 | 1 | -1/+2 |
| | | | | | | params (#95347) Fixes GH-83901 | ||||
* | GH-96073: Fix wild replacement in inspect.formatannotation (#96074) | Anh71me | 2022-10-07 | 1 | -0/+7 |
| | | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> | ||||
* | gh-65961: Do not rely solely on `__cached__` (GH-97990) | Brett Cannon | 2022-10-06 | 1 | -0/+3 |
| | | | Make sure `__spec__.cached` (at minimum) can be used. | ||||
* | gh-84753: Make inspect.iscoroutinefunction() work with AsyncMock (#94050) | Mehdi ABAAKOUK | 2022-06-30 | 1 | -0/+14 |
| | | | | | | | | | The inspect version was not working with unittest.mock.AsyncMock. The fix introduces special-casing of AsyncMock in `inspect.iscoroutinefunction` equivalent to the one performed in `asyncio.iscoroutinefunction`. Co-authored-by: Łukasz Langa <lukasz@langa.pl> | ||||
* | gh-90473: Skip tests that don't apply to Emscripten and WASI (GH-92846) | Christian Heimes | 2022-05-16 | 1 | -1/+4 |
| | |||||
* | gh-92062: `inspect.Parameter` checks whether `name` is a keyword (GH-92065) | Zac Hatfield-Dodds | 2022-05-03 | 1 | -0/+3 |
| | | | Fixes #92062. | ||||
* | gh-88116: Enhance the inspect frame APIs to use the extended position ↵ | Pablo Galindo Salgado | 2022-04-23 | 1 | -7/+21 |
| | | | | information (GH-91531) | ||||
* | bpo-29418: Implement inspect.ismethodwrapper and fix inspect.isroutine for ↵ | Hakan Çelik | 2022-02-16 | 1 | -3/+43 |
| | | | | | cases where methodwrapper is given (GH-19261) Automerge-Triggered-By: GH:isidentical | ||||
* | bpo-40280: Address more test failures on Emscripten (GH-31050) | Christian Heimes | 2022-02-05 | 1 | -0/+1 |
| | | | Co-authored-by: Brett Cannon <brett@python.org> | ||||
* | bpo-46565: `del` loop vars that are leaking into module namespaces (GH-30993) | Nikita Sobolev | 2022-02-03 | 1 | -1/+1 |
| | |||||
* | bpo-46103: Fix inspect.getmembers to only get __bases__ from class (GH-30147) | Weipeng Hong | 2022-01-23 | 1 | -0/+5 |
| | |||||
* | bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' ↵ | Weipeng Hong | 2022-01-21 | 1 | -0/+11 |
| | | | | (GH-30285) | ||||
* | bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638) | Irit Katriel | 2022-01-18 | 1 | -2/+2 |
| | |||||
* | Remove spaces in empty lines (GH-30121) | AN Long | 2021-12-15 | 1 | -1/+1 |
| | |||||
* | bpo-27062: add `__all__` to inspect module (GH-30003) | Kumar Aditya | 2021-12-10 | 1 | -0/+3 |
| | |||||
* | bpo-30533:Add function inspect.getmembers_static that does not call ↵ | Weipeng Hong | 2021-11-30 | 1 | -0/+17 |
| | | | | | | | | | | | | | | | | | | | | | properties or dynamic properties. (#20911) * Add function inspect.getmembers_static that does not call properties or dynamic properties. * update _getmembers args * Update Misc/NEWS.d/next/Library/2020-06-16-18-00-56.bpo-30533.StL57t.rst Co-authored-by: Itamar Ostricher <itamarost@gmail.com> * Update Lib/inspect.py Co-authored-by: Itamar Ostricher <itamarost@gmail.com> * Removes the copy pasted doc string Co-authored-by: Itamar Ostricher <itamarost@gmail.com> Co-authored-by: Dino Viehland <dinoviehland@gmail.com> | ||||
* | bpo-45406: make inspect.getmodule() return None when getabsfile() raises ↵ | Irit Katriel | 2021-11-02 | 1 | -0/+9 |
| | | | | FileNotFoundError (GH-28824) | ||||
* | bpo-45438: format of inspect.Signature with generic builtins (#29212) | Martin Rueckl | 2021-10-27 | 1 | -0/+11 |
| | | | | | | | Use types.GenericAlias in inspect.formatannotation to correctly add type arguments of builtin types to the string representation of Signatures. Co-authored-by: Martin Rückl <martin.rueckl@codecentric.de> |