aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/importlib/_bootstrap_external.py
Commit message (Collapse)AuthorAge
* GH-120507: Lower the `BEFORE_WITH` and `BEFORE_ASYNC_WITH` instructions. ↵Mark Shannon2024-06-18
| | | | | | | | | (#120640) * Remove BEFORE_WITH and BEFORE_ASYNC_WITH instructions. * Add LOAD_SPECIAL instruction * Reimplement `with` and `async with` statements using LOAD_SPECIAL
* gh-119311: Fix name mangling with PEP 695 generic classes (#119464)Jelle Zijlstra2024-05-27
| | | | Fixes #119311. Fixes #119395.
* gh-119180: Update the magic number (#119397)Jelle Zijlstra2024-05-24
| | | | PR #119321 added a comment about the magic number bump but did not actually apply the new magic number.
* gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)Jelle Zijlstra2024-05-22
| | | | | | | | | | The PEP 649 implementation will require a way to load NotImplementedError from the bytecode. @markshannon suggested implementing this by converting LOAD_ASSERTION_ERROR into a more general mechanism for loading constants. This PR adds this new opcode. I will work on the rest of the implementation of the PEP separately. Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* Fix typo inaccuracy in _bootstrap_external.py (GH-118619)wim glenn2024-05-07
|
* gh-118465: Add __firstlineno__ attribute to class (GH-118475)Serhiy Storchaka2024-05-06
| | | | It is set by compiler with the line number of the first line of the class definition.
* gh-89739: gh-77140: Support zip64 in zipimport (GH-94146)Tim Hatch2024-03-28
| | | | | | | | | | | | | | | * Reads zip64 files as produced by the zipfile module * Include tests (somewhat slow, however, because of the need to create "large" zips) * About the same amount of strictness reading invalid zip files as zipfile has * Still works on files with prepended data (like pex) There are a lot more test cases at https://github.com/thatch/zipimport64/ that give me confidence that this works for real-world files. Fixes #89739 and #77140. --------- Co-authored-by: Itamar Ostricher <itamarost@gmail.com> Reviewed-by: Gregory P. Smith <greg@krypto.org>
* gh-114099 - Add iOS framework loading machinery. (GH-116454)Russell Keith-Magee2024-03-19
| | | | Co-authored-by: Malcolm Smith <smith@chaquo.com> Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-116811: Ensure MetadataPathFinder.invalidate_caches is reachable when ↵Jason R. Coombs2024-03-14
| | | | | | | | | delegated through PathFinder. (#116812) * Make MetadataPathFinder a proper classmethod. * In PathFinder.invalidate_caches, also invoke MetadataPathFinder.invalidate_caches. * Add blurb
* gh-116381: Specialize CONTAINS_OP (GH-116385)Ken Jin2024-03-07
| | | | | | | | | | | * Specialize CONTAINS_OP * 📜🤖 Added by blurb_it. * Add PyAPI_FUNC for JIT --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* GH-112354: `END_FOR` instruction to only pop one value. (GH-114247)Mark Shannon2024-01-24
| | | | * Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.
* gh-114265: move line number propagation before cfg optimization, remove ↵Irit Katriel2024-01-19
| | | | guarantee_lineno_for_exits (#114267)
* gh-107901: synthetic jumps which are not at end of loop no longer check the ↵Irit Katriel2024-01-06
| | | | eval breaker (#113721)
* gh-112983: Add the known magic value of 3495 for Python 3.11 bytecode (#112985)wim glenn2023-12-11
| | | Add the known magic value of 3495 for Python 3.11 bytecode
* gh-111354: Simplify _PyGen_yf by moving some of its work to the compiler and ↵Irit Katriel2023-11-03
| | | | frame state (#111648)
* gh-111354: simplify detection of RESUME after YIELD_VALUE at except-depth 1 ↵Irit Katriel2023-11-02
| | | | (#111459)
* GH-105848: Replace KW_NAMES + CALL with LOAD_CONST + CALL_KW (GH-109300)Brandt Bucher2023-09-13
|
* gh-109256: allocate opcode IDs for internal opcodes in their own range (#109269)Irit Katriel2023-09-12
|
* gh-109039: Branch prediction for Tier 2 interpreter (#109038)Guido van Rossum2023-09-11
| | | | | | | | | | | This adds a 16-bit inline cache entry to the conditional branch instructions POP_JUMP_IF_{FALSE,TRUE,NONE,NOT_NONE} and their instrumented variants, which is used to keep track of the branch direction. Each time we encounter these instructions we shift the cache entry left by one and set the bottom bit to whether we jumped. Then when it's time to translate such a branch to Tier 2 uops, we use the bit count from the cache entry to decided whether to continue translating the "didn't jump" branch or the "jumped" branch. The counter is initialized to a pattern of alternating ones and zeros to avoid bias. The .pyc file magic number is updated. There's a new test, some fixes for existing tests, and a few miscellaneous cleanups.
* GH-108614: Increase importlib MAGIC for RESUME_CHECK instruction (#109247)Victor Stinner2023-09-11
|
* gh-105481: generate op IDs from bytecode.c instead of hard coding them in ↵Irit Katriel2023-08-16
| | | | opcode.py (#107971)
* GH-105848: Simplify the arrangement of CALL's stack (GH-107788)Brandt Bucher2023-08-09
|
* GH-106008: Make implicit boolean conversions explicit (GH-106003)Brandt Bucher2023-06-29
|
* gh-105775: Convert LOAD_CLOSURE to a pseudo-op (#106059)hms2023-06-29
| | | | | | This enables super-instruction formation, removal of checks for uninitialized variables, and frees up an instruction.
* gh-105481: generate _specializations and _specialized_instructions from ↵Irit Katriel2023-06-19
| | | | bytecodes.c (#105913)
* GH-77273: Better bytecodes for f-strings (GH-6132)Mark Shannon2023-06-14
|
* Fix magic number (GH-105722)Mark Shannon2023-06-13
|
* GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE ↵Mark Shannon2023-06-13
| | | | (GH-105680)
* GH-105229: Replace some superinstructions with single instruction ↵Mark Shannon2023-06-05
| | | | equivalent. (GH-105230)
* GH-104584: Plugin optimizer API (GH-105100)Mark Shannon2023-06-02
|
* gh-103763: Implement PEP 695 (#103764)Jelle Zijlstra2023-05-15
| | | | | | | | | | | | | | This implements PEP 695, Type Parameter Syntax. It adds support for: - Generic functions (def func[T](): ...) - Generic classes (class X[T](): ...) - Type aliases (type X = ...) - New scoping when the new syntax is used within a class body - Compiler and interpreter changes to support the new syntax and scoping rules Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Eric Traut <eric@traut.com> Co-authored-by: Larry Hastings <larry@hastings.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-87729: improve hit rate of LOAD_SUPER_ATTR specialization (#104270)Carl Meyer2023-05-11
|
* gh-97933: (PEP 709) inline list/dict/set comprehensions (#101441)Carl Meyer2023-05-09
| | | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-98040: Remove find_loader, find_module and other deprecated APIs (#98059)Barry Warsaw2023-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove deprecated classes from pkgutil * Remove some other PEP 302 obsolescence * Use find_spec instead of load_module * Remove more tests of PEP 302 obsolete APIs * Remove another bunch of tests using obsolete load_modules() * Remove deleted names from __all__ * Remove obsolete footnote * imp is removed * Remove `imp` from generated stdlib names * What's new and blurb * Update zipimport documentation for the removed methods * Fix some Windows tests * Remove any test (or part of a test) that references `find_module()`. * Use assertIsNone() / assertIsNotNone() consistently. * Update Doc/reference/import.rst * We don't need pkgutil._get_spec() any more either * test.test_importlib.fixtures.NullFinder * ...BadLoaderFinder.find_module * ...test_api.InvalidatingNullFinder.find_module * ...test.test_zipimport test of z.find_module * Suppress cross-references to find_loader and find_module * Suppress cross-references to Finder * Suppress cross-references to pkgutil.ImpImporter and pkgutil.ImpLoader --------- Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* gh-87729: specialize LOAD_SUPER_ATTR_METHOD (#103809)Carl Meyer2023-04-25
|
* gh-87729: add LOAD_SUPER_ATTR instruction for faster super() (#103497)Carl Meyer2023-04-24
| | | | | This speeds up `super()` (by around 85%, for a simple one-level `super().meth()` microbenchmark) by avoiding allocation of a new single-use `super()` object on each use.
* GH-103082: Implementation of PEP 669: Low Impact Monitoring for CPython ↵Mark Shannon2023-04-12
| | | | | | | | | | (GH-103083) * The majority of the monitoring code is in instrumentation.c * The new instrumentation bytecodes are in bytecodes.c * legacy_tracing.c adapts the new API to the old sys.setrace and sys.setprofile APIs
* GH-88691: Shrink the CALL caches (GH-103230)Brandt Bucher2023-04-05
|
* GH-89987: Shrink the BINARY_SUBSCR caches (GH-103022)Brandt Bucher2023-03-29
|
* GH-100982: Break up COMPARE_AND_BRANCH (GH-102801)Brandt Bucher2023-03-23
|
* gh-102859: Remove JUMP_IF_FALSE_OR_POP and JUMP_IF_TRUE_OR_POP (#102870)Irit Katriel2023-03-22
|
* GH-90997: Shrink the LOAD_GLOBAL caches (#102569)Brandt Bucher2023-03-10
|
* gh-101799: implement PREP_RERAISE_STAR as an intrinsic function (#101800)Irit Katriel2023-02-14
|
* GH-87849: Simplify stack effect of SEND and specialize it for generators and ↵Mark Shannon2023-02-13
| | | | coroutines. (GH-101788)
* gh-101632: Add the new RETURN_CONST opcode (#101633)penguin_wwy2023-02-07
|
* Fix incorrect versions in magic number comments (GH-101301)Brandt Bucher2023-01-25
|
* GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. ↵Mark Shannon2023-01-24
| | | | | | (GH-101013) * Store exception stack depth in YIELD_VALUE's oparg and use it avoid expensive gen.throw() in gen.close() where possible.
* GH-100982: Add `COMPARE_AND_BRANCH` instruction (GH-100983)Mark Shannon2023-01-16
|
* GH-100923: Embed jump mask in `COMPARE_OP` oparg (GH-100924)Mark Shannon2023-01-11
|
* GH-99005: More intrinsics (GH-100774)Mark Shannon2023-01-06
| | | * Remove UNARY_POSITIVE, LIST_TO_TUPLE and ASYNC_GEN_WRAP, replacing them with intrinsics.