Merged
Merged
Conversation
JelleZijlstra
changed the title
gh-130907: Error when accessing __annotations__ on a partially defined module
gh-130907: Treat all module-level annotations as conditional
| self.assertNotIn('__annotate__', gns) | ||
|
|
||
| gns.update(lns) # __annotate__ looks at globals | ||
| self.assertEqual(lns["__annotate__"](annotationlib.Format.VALUE), {'x': int}) |
| int _PyInstructionSequence_InsertInstruction(_PyInstructionSequence *seq, int pos, | ||
| int opcode, int oparg, _Py_SourceLocation loc); | ||
| int _PyInstructionSequence_PrependSequence(_PyInstructionSequence *seq, int pos, | ||
| _PyInstructionSequence *nested); |
| } | ||
|
|
||
| instr_sequence *old_instr_seq = INSTR_SEQUENCE(c); | ||
| instr_sequence *nested_instr_seq = NULL; |
Closed
| if (nested_instr_seq == NULL) { | ||
| bool need_separate_block = scope_type == COMPILE_SCOPE_MODULE; | ||
| if (need_separate_block) { | ||
| if (_PyCompile_StartAnnotationSetup(c) == ERROR) { |
Labels
None yet