Jelle Zijlstra
898e6b395e
gh-130881: Handle conditionally defined annotations ( #130935 )
2025-03-26 03:48:19 +00:00
Irit Katriel
ffc2f1dd1c
gh-130080: implement PEP 765 ( #130087 )
2025-03-17 20:48:54 +00:00
Mark Shannon
a45f25361d
GH-131238: More refactoring of core header files (GH-131351)
...
Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.
2025-03-17 14:41:05 +00:00
Victor Stinner
978e37bb5f
gh-131238: Add explicit includes to pycore headers ( #131257 )
2025-03-17 12:32:43 +01:00
Hugo Beauzée-Luyssen
830f04b505
Postpone <stdbool.h> inclusion after Python.h ( #130641 )
...
Remove inclusions prior to Python.h.
<stdbool.h> will cause <features.h> to be included before Python.h can
define some macros to enable some additional features, causing multiple
types not to be defined down the line.
2025-02-28 10:09:27 +01:00
Victor Stinner
95504f429e
gh-129354: Fix grammar in PyErr_FormatUnraisable() ( #129475 )
...
Replace "on verb+ing" with "while verb+ing".
2025-01-31 09:45:35 +01:00
mpage
255762c09f
gh-127274: Defer nested methods ( #128012 )
...
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.
2024-12-19 13:03:14 -08:00
Bénédikt Tran
c222441fa7
gh-120017: use 'do-while(0)' in some `{codegen,compile}.c` multi-line macros ( #120018 )
2024-11-07 23:03:11 +00:00
Valery Fedorenko
8525c9375f
gh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg ( #126239 )
...
* Replace Py_DECREF by Py_XDECREF
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-11-05 20:34:33 +03:00
Xuanteng Huang
35df4eb959
gh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101)
2024-10-30 09:01:09 +00:00
Mikhail Efimov
9a35d05338
gh-121404: typo fix in compile.c: MATADATA -> METADATA ( #125101 )
2024-10-08 12:18:28 +00:00
Kira
04c837d9d8
gh-124442: make `__static_attributes__` deterministic by sorting ( #124492 )
...
Signed-off-by: kp2pml30 <kp2pml30@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-09-28 15:15:43 -07:00
Irit Katriel
aba42c0b54
gh-123969: refactor _PyErr_RaiseSyntaxError and _PyErr_EmitSyntaxWarning out of compiler ( #123972 )
2024-09-16 15:05:00 +01:00
Irit Katriel
9aa1f60e2d
gh-124058: remove _PyCompile_IsNestedScope, roll it into _PyCompile_IsInteractive ( #124061 )
2024-09-16 06:58:18 -07:00
Irit Katriel
a9594a34c6
gh-124022: Fix bug where class docstring is removed in interactive mode ( #124023 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-13 14:06:06 +00:00
Irit Katriel
8145ebea58
gh-124013: remove _PyCompile_IsTopLevelAwait ( #124014 )
2024-09-12 19:58:32 +01:00
Irit Katriel
a2d0818c85
gh-123881: make compiler add the .generic_base base class without constructing AST nodes ( #123883 )
2024-09-10 16:16:00 +00:00
Irit Katriel
1a9d8917a3
gh-121404: split compile.c into compile.c and codegen.c ( #123651 )
2024-09-09 18:21:51 +01:00
Irit Katriel
fbb26f067a
gh-121404: enforce that codegen doesn't access compiler, and compiler doesn't use codegen macros ( #123575 )
2024-09-02 17:23:39 +00:00
sobolevn
91b7f2e7f6
gh-123553: Fix compile warning in `compile.c` ( #123578 )
2024-09-01 15:43:45 +00:00
Kirill Podoprigora
084e0f35d1
gh-123553: Fix compiler warning in `Python/compile.c` ( #123554 )
2024-09-01 06:29:34 +00:00
Irit Katriel
6bfbfc6af3
gh-121404: rearrange code in compile.c so that codegen functions come first and compiler functions second ( #123510 )
2024-08-30 22:54:42 +01:00
Irit Katriel
61bef6245c
gh-123142: fix too wide source location of GET_ITER/GET_AITER ( #123420 )
2024-08-28 17:11:52 +01:00
Irit Katriel
d24d1c986d
gh-121404: split compiler_nameop into a codegen part and a compiler part ( #123398 )
2024-08-27 16:57:31 +01:00
Irit Katriel
da4302699f
gh-121404: compiler_visit_* --> codegen_visit_* ( #123382 )
2024-08-27 11:32:24 +00:00
Irit Katriel
bf1b5d323b
gh-121404: more compiler_* -> codegen_*, class_body and comprehensions ( #123262 )
2024-08-23 19:53:15 +01:00
Irit Katriel
5fce482c9a
gh-121404: compiler_annassign --> codegen_annassign ( #123245 )
2024-08-23 10:39:42 +01:00
Irit Katriel
4abc1c1456
gh-121404: remove redundant c_nestlevel. more compiler abstractions. more macro usage consistency ( #123225 )
2024-08-22 15:08:16 +01:00
Irit Katriel
ec89620e5e
gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions ( #123173 )
2024-08-21 19:12:05 +01:00
Irit Katriel
4b7c4880a0
gh-121404: split fblock handling into compiler_* and codegen_* parts ( #123199 )
2024-08-21 15:48:56 +01:00
Irit Katriel
bffed80230
gh-123048: Fix missing source location in pattern matching code ( #123167 )
2024-08-20 11:39:41 +01:00
Irit Katriel
b6d0a40a42
gh-121404: rename functions to use codegen_* prefix. Use macros more consistently. ( #123139 )
2024-08-19 14:39:53 +00:00
Irit Katriel
e077b201f4
gh-121404: pass metadata to compiler_enter_scope (optionally) so that codegen functions don't need to set it on the code unit ( #123078 )
2024-08-19 11:49:42 +01:00
Irit Katriel
e2f2dc708e
gh-121404: rename compiler_addop* to codegen_addop*, and replace direct usages by the macros ( #123043 )
2024-08-16 15:57:32 +01:00
Irit Katriel
b6cb435ac0
gh-121404: split compiler's push/pop_inlined_comprehension_state into codegen and compiler parts ( #123021 )
2024-08-15 11:08:54 +00:00
Irit Katriel
05fc4d758a
gh-122985: add SYMBOL_TO_SCOPE macro in symtable ( #122986 )
2024-08-14 06:17:04 +01:00
Mark Shannon
fe23f8ed97
GH-122821: Simplify compilation of while statements to ensure consistency of offsets for sys.monitoring (GH-122934)
2024-08-13 10:25:44 +01:00
Serhiy Storchaka
e74680b718
gh-122595: Add more error checks in the compiler (GH-122596)
2024-08-06 08:59:44 +03:00
Irit Katriel
498376d7a7
gh-122445: populate only modified fields in __static_attributes__ ( #122446 )
2024-08-02 15:40:42 +01:00
Jelle Zijlstra
ae192262ad
gh-119180: Add evaluate functions for type params and type aliases ( #122212 )
2024-07-27 17:24:10 +00:00
Irit Katriel
bc94cf7e25
gh-122245: move checks for writes and shadowing of __debug__ to symtable ( #122246 )
2024-07-26 14:39:56 +01:00
Mark Shannon
2e14a52cce
GH-122160: Remove BUILD_CONST_KEY_MAP opcode. (GH-122164)
2024-07-25 16:24:29 +01:00
Irit Katriel
9ac606080a
gh-121404: extract compiler_lookup_arg out of compiler_make_closure ( #122181 )
2024-07-24 17:22:18 +01:00
Jelle Zijlstra
2762c6cc5e
gh-121637: Syntax error for optimized-away incorrect await ( #121656 )
...
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-22 14:12:43 -07:00
Irit Katriel
d5a12b4440
gh-121404: move calculation of module start location from compiler_body up to compiler_codegen ( #122127 )
2024-07-22 17:48:30 +01:00
Gregor
178e44de8f
gh-121657: Display correct error message for yield from outside of a function (GH-121680)
...
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-13 17:14:39 +02:00
Irit Katriel
6557af6698
gh-121554: remove unnecessary internal functions in compile.c ( #121555 )
...
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-07-10 23:48:37 +01:00
Irit Katriel
0177a34335
gh-121404: remove some accesses to compiler internals from codegen functions ( #121538 )
2024-07-10 17:09:45 +01:00
Irit Katriel
cced22c760
gh-121547: deduplicate the code of const_cache update functions ( #121548 )
2024-07-10 10:34:54 +00:00
Irit Katriel
2be37ec8e2
gh-121404: remove direct accesses to u_private from codegen functions ( #121500 )
2024-07-08 21:02:01 +01:00