summaryrefslogtreecommitdiff
path: root/Python/importlib_external.h
AgeCommit message (Collapse)AuthorLines
2018-05-29bpo-32911: Revert bpo-29463. (GH-7121)Serhiy Storchaka-1482/+1483
Remove the docstring attribute of AST types and restore docstring expression as a first stmt in their body. Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-04-06[3.7] bpo-33169: Remove values of `None` from sys.path_importer_cache when ↵Brett Cannon-611/+614
invalidating caches (GH-6402) (GH-6403) An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense. (cherry picked from commit 9e2be60634914f23db2ae5624e4acc9335bf5fea)
2018-02-23bpo-32838: Fix Python versions in the table of magic numbers. (GH-5658)Miss Islington (bot)-117/+117
(cherry picked from commit 4af8fd561433826ac897c55e41a087a5c5dbacf3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-02bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5503)Barry Warsaw-481/+480
* Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages. * Make sure ``__spec__.origin` matches ``__file__`` for namespace packages. https://bugs.python.org/issue32303 https://bugs.python.org/issue32305 (cherry picked from commit bbbcf8693b876daae4469765aa62f8924f39a7d2) Co-authored-by: Barry Warsaw <barry@python.org>
2018-01-29bpo-32550. Remove the STORE_ANNOTATION bytecode. (GH-5181)Mark Shannon-112/+112
2018-01-15Implement the get_resource_reader() API for file system imports (#5168)Barry Warsaw-1248/+1307
2018-01-09bpo-24340: Fix estimation of the code stack size. (#5076)Serhiy Storchaka-1094/+1094
2017-12-14bpo-29469: Optimize literal lists and sets iterating on the AST level. (#4866)Serhiy Storchaka-1979/+1978
2017-12-14bpo-29469: Move constant folding to AST optimizer (GH-2858)INADA Naoki-1995/+1989
2017-12-09closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson-2383/+2513
Python now supports checking bytecode cache up-to-dateness with a hash of the source contents rather than volatile source metadata. See the PEP for details. While a fairly straightforward idea, quite a lot of code had to be modified due to the pervasiveness of pyc implementation details in the codebase. Changes in this commit include: - The core changes to importlib to understand how to read, validate, and regenerate hash-based pycs. - Support for generating hash-based pycs in py_compile and compileall. - Modifications to our siphash implementation to support passing a custom key. We then expose it to importlib through _imp. - Updates to all places in the interpreter, standard library, and tests that manually generate or parse pyc files to grok the new format. - Support in the interpreter command line code for long options like --check-hash-based-pycs. - Tests and documentation for all of the above.
2017-10-06bpo-31709: Update importlib magic (#3906)Yury Selivanov-104/+104
2017-09-18Trivial cleanups following bpo-31370 (#3649)Antoine Pitrou-72/+70
* Trivial cleanups following bpo-31370 * Also cleanup the "importlib._bootstrap_external" module
2017-06-11bpo-30501: Make the compiler producing optimized code for condition ↵Serhiy Storchaka-1986/+1985
expressions. (#1851)
2017-04-16bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka-1406/+1406
2017-02-22bpo-29463: Add docstring field to some AST nodes. (#46)INADA Naoki-1247/+1246
* bpo-29463: Add docstring field to some AST nodes. ClassDef, ModuleDef, FunctionDef, and AsyncFunctionDef has docstring field for now. It was first statement of there body. * fix document. thanks travis! * doc fixes
2016-12-13Issue #26110: Add LOAD_METHOD/CALL_METHOD opcodes.Yury Selivanov-342/+342
Special thanks to INADA Naoki for pushing the patch through the last mile, Serhiy Storchaka for reviewing the code, and to Victor Stinner for suggesting the idea (originally implemented in the PyPy project).
2016-12-12Issue #28896: Disable WindowsRegistryFinder by default.Steve Dower-56/+53
2016-12-05Issue #23722: improve __classcell__ compatibilityNick Coghlan-1177/+1177
Handling zero-argument super() in __init_subclass__ and __set_name__ involved moving __class__ initialisation to type.__new__. This requires cooperation from custom metaclasses to ensure that the new __classcell__ entry is passed along appropriately. The initial implementation of that change resulted in abruptly broken zero-argument super() support in metaclasses that didn't adhere to the new requirements (such as Django's metaclass for Model definitions). The updated approach adopted here instead emits a deprecation warning for those cases, and makes them work the same way they did in Python 3.5. This patch also improves the related class machinery documentation to cover these details and to include more reader-friendly cross-references and index entries.
2016-10-25Issue #28517: Fixed of-by-one error in the peephole optimizer that causedSerhiy Storchaka-1958/+1957
keeping unreachable code.
2016-10-02Issue #28257: Improved error message when pass a non-iterable asSerhiy Storchaka-106/+106
a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
2016-09-30Issue #27942: String constants now interned recursively in tuples and ↵Serhiy Storchaka-1886/+1883
frozensets.
2016-09-30Issue #27942: String constants now interned recursively in tuples and ↵Serhiy Storchaka-801/+800
frozensets.
2016-09-12Issue #27213: Fixed different issues with reworked CALL_FUNCTION* opcodes.Serhiy Storchaka-1902/+1902
* BUILD_TUPLE_UNPACK and BUILD_MAP_UNPACK_WITH_CALL no longer generated with single tuple or dict. * Restored more informative error messages for incorrect var-positional and var-keyword arguments. * Removed code duplications in _PyEval_EvalCodeWithName(). * Removed redundant runtime checks and parameters in _PyStack_AsDict(). * Added a workaround and enabled previously disabled test in test_traceback. * Removed dead code from the dis module.
2016-09-11Issue #23722: Initialize __class__ from type.__new__()Nick Coghlan-1242/+1243
The __class__ cell used by zero-argument super() is now initialized from type.__new__ rather than __build_class__, so class methods relying on that will now work correctly when called from metaclass methods during class creation. Patch by Martin Teichmann.
2016-09-09Issue #24320: Drop an old setuptools-induced hack.Eric Snow-53/+52
2016-09-09Rework CALL_FUNCTION* opcodesVictor Stinner-1603/+1604
Issue #27213: Rework CALL_FUNCTION* opcodes to produce shorter and more efficient bytecode: * CALL_FUNCTION now only accepts position arguments * CALL_FUNCTION_KW accepts position arguments and keyword arguments, but keys of keyword arguments are packed into a constant tuple. * CALL_FUNCTION_EX is the most generic, it expects a tuple and a dict for positional and keyword arguments. CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW opcodes have been removed. 2 tests of test_traceback are currently broken: skip test, the issue #28050 was created to track the issue. Patch by Demur Rumed, design by Serhiy Storchaka, reviewed by Serhiy Storchaka and Victor Stinner.
2016-09-08Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.Yury Selivanov-104/+104
Patch by Ivan Levkivskyi.
2016-09-07Issue #26667: Add path-like object support to importlib.util.Brett Cannon-2164/+2168
2016-09-06Issue #27078: Added BUILD_STRING opcode. Optimized f-strings evaluation.Serhiy Storchaka-104/+104
2016-07-16Check in update for importlib_external.hBrett Cannon-2404/+2412
2016-07-16Fix regressions introduced by fixes for issue #27083.Brett Cannon-2551/+2561
2016-07-15Merge for #27083Brett Cannon-2339/+2341
2016-07-08Update frozen importlib codeBrett Cannon-597/+596
2016-06-12Issue #27095: Simplified MAKE_FUNCTION and removed MAKE_CLOSURE opcodes.Serhiy Storchaka-2220/+2223
Patch by Demur Rumed.
2016-06-12Comment fixes extracted from patch by Demur Rumed.Serhiy Storchaka-103/+103
2016-06-12Issue #27286: Fixed compiling BUILD_MAP_UNPACK_WITH_CALL opcode. CallingSerhiy Storchaka-103/+103
function with generalized unpacking (PEP 448) and conflicting keyword names could cause undefined behavior.
2016-06-12Issue #27286: Fixed compiling BUILD_MAP_UNPACK_WITH_CALL opcode. CallingSerhiy Storchaka-104/+104
function with generalized unpacking (PEP 448) and conflicting keyword names could cause undefined behavior.
2016-06-12Issue #27140: Added BUILD_CONST_KEY_MAP opcode.Serhiy Storchaka-1155/+1155
2016-05-28Issue #27138: Regenerate Python/importlib_external.h.Serhiy Storchaka-324/+323
2016-05-28Issue #27138: Regenerate Python/importlib_external.h.Serhiy Storchaka-344/+343
2016-05-24Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode.Serhiy Storchaka-2390/+2222
Patch by Demur Rumed.
2016-05-16regen importlib bytecodeBenjamin Peterson-103/+103
2016-05-16Issue #27039: Fixed bytearray.remove() for values greater than 127.Serhiy Storchaka-103/+103
Based on patch by Joe Jevnik.
2016-03-15regrtest: Fix module.__path__Victor Stinner-931/+940
Issue #26538: libregrtest: Fix setup_tests() to keep module.__path__ type (_NamespacePath), don't convert to a list. Add _NamespacePath.__setitem__() method to importlib._bootstrap_external.
2016-02-11Issue #25985: sys.version_info is now used instead of sys.versionSerhiy Storchaka-15/+16
to format short Python version.
2016-01-20co_lnotab supports negative line number deltaVictor Stinner-105/+106
Issue #26107: The format of the co_lnotab attribute of code objects changes to support negative line number delta. Changes: * assemble_lnotab(): if line number delta is less than -128 or greater than 127, emit multiple (offset_delta, lineno_delta) in co_lnotab * update functions decoding co_lnotab to use signed 8-bit integers - dis.findlinestarts() - PyCode_Addr2Line() - _PyCode_CheckLineNumber() - frame_setlineno() * update lnotab_notes.txt * increase importlib MAGIC_NUMBER to 3361 * document the change in What's New in Python 3.6 * cleanup also PyCode_Optimize() to use better variable names
2015-12-28Issue #25802: Deprecate load_module() on ↵Brett Cannon-1516/+1517
importlib.machinery.SourceFileLoader and SourcelessFileLoader. They were the only remaining implementations of load_module() not documented as deprecated.
2015-11-03Issue 25483: Add an opcode to make f-string formatting more robust.Eric V. Smith-103/+103
2015-10-01Update importlib_external.hVictor Stinner-56/+57
2015-09-25Issue #25186: Remove duplicated function from importlib._bootstrap_externalBrett Cannon-2497/+2480