GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-28556: Various updates to typing (#28) by Mariatta · Pull Request #77 · python/cpython

Conversation

@Mariatta

@Mariatta Mariatta commented Feb 13, 2017

Copy link
Copy Markdown
Member

various updates from upstream python/typing repo:

  • Added typing.Counter and typing.ChainMap generics
  • More flexible typing.NamedTuple
  • Improved generic ABC caching
  • More tests
  • Bugfixes
  • Other updates
  • Add Misc/NEWS entry

  • Add issue number

Contributed by Ivan Levkivskyi @ilevkivskyi

(cherry picked from commit b692dc8)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ilevkivskyi @Mariatta
bpo-28556: Various updates to typing (#28)
8d3f5f6
 various updates from upstream python/typing repo:

- Added typing.Counter and typing.ChainMap generics
- More flexible typing.NamedTuple
- Improved generic ABC caching
- More tests
- Bugfixes
- Other updates

* Add Misc/NEWS entry

* Add issue number

(cherry picked from commit b692dc8)
@Mariatta Mariatta added the cherry-pick for 3.6 label Feb 13, 2017
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 13, 2017
@Mariatta Mariatta mentioned this pull request Feb 13, 2017
bpo-28556: Various updates to typing #28
Merged
berkerpeksag
berkerpeksag approved these changes Feb 14, 2017
View reviewed changes
@Mariatta
Mariatta merged commit 0230e64 into python:3.6 Feb 14, 2017
@Mariatta
Mariatta deleted the bpo-28556-3.6 branch February 14, 2017 14:11
colesbury referenced this pull request in colesbury/nogil Oct 6, 2021
@colesbury
typeobject: make some method descriptors immortal
2dec467
This makes method descriptors for non-heap types immortal.
The underlying logic is that the types are immortal so the
methods will live for the lifetime of the program as well.

See #77
jaraco pushed a commit that referenced this pull request Dec 2, 2022
@pyup-bot @Mariatta
Update pytest from 3.4.2 to 3.5.0 (GH-77)
ce45f23
jaraco added a commit to jaraco/cpython that referenced this pull request Feb 17, 2023
@jaraco
Initial draft of a TraversableResource abc. Ref python#77.
9e71728
jaraco added a commit to jaraco/cpython that referenced this pull request Feb 17, 2023
@jaraco
trees.from_package now supports TraversableResources loaders. Closes p…
54debaf
…ython#77.
jaraco added a commit to jaraco/cpython that referenced this pull request Feb 17, 2023
@jaraco
Update changelog. Ref python#77.
6290675
jaraco added a commit to jaraco/cpython that referenced this pull request Feb 17, 2023
@jaraco
Merge branch 'feature/extensible-traversable' into 'master'
81e7f72
Extensibility support for traversable objects

Closes python#77

See merge request python-devs/importlib_resources!85
@gvanrossum gvanrossum mentioned this pull request Aug 22, 2023
heap-use-after-free in _PyFunction_LookupByVersion #108253
Closed
lysnikolaou referenced this pull request in lysnikolaou/cpython May 1, 2024
@pablogsal
Merge pull request #77 from lysnikolaou/pyrepl-fix-disp-str-ctrl
07345da
Fix disp_str for control characters
@ngoldbaum ngoldbaum mentioned this pull request Sep 23, 2024
Crash running PyO3 tests with --test-threads=1000 #124375
Closed
This was referenced Feb 11, 2025
segmentfault when pip installing setuptools #129992
Closed
segmentfault when pip installing setuptools #129993
Closed
@sergey-miryanov sergey-miryanov mentioned this pull request Dec 18, 2025
Observed memory leak in ssl library: Python 3.14 GC issue #142516
Closed
@ngoldbaum ngoldbaum mentioned this pull request Mar 6, 2026
Remove deprecated and undocumented function ctypes.SetPointerType #133866
Closed
SonicField added a commit to SonicField/cpython that referenced this pull request Apr 22, 2026
@SonicField
builder: emitAnyCall await-tail → C (PartialConversion, 102/144 → 103…
b28b512
…/144 = 71.5%)

PartialConversion per theologian PTE pre-audit (chat 2026-04-22 17:15Z) +
supervisor concurrence (chat 17:18Z) + Alex 'NO SESSION BOUNDARIES — keep
working until ZERO C++' anchor [memory 2026-04-21]. Bridge-count gate
satisfied: 1 new top-level bridge (within gate), 0 sub-bridges.

SCOPE: only the await-tail dispatch (lines 2963-2993 in pre-conversion
source) is converted to C. The opcode-switch + INVOKE_FUNCTION/NATIVE/
METHOD/METHOD_VECTORCALL dispatch stay C++ until Tier 6 INVOKE_*
re-architecture (deferred per gate-count gate per [chat L1922]:
FullConversion would require 4+ new bridges, violating ≤1 limit).

  Python/jit/hir/builder.cpp:
    emitAnyCall await-tail block (lines 2963-2993, ~30 lines C++) →
    1) C++ stub: 3x ++bc_it + 3x JIT_CHECK on opcode sequence (PA + A4) +
       checkAsyncWithError(get_awaitable_bc) → (error_aenter, error_aexit) +
       extract load_const_oparg from LOAD_CONST bc + call C body
    2) checkAsyncWithError forward decl added (defined static at builder.cpp
       :~4856, post-call-site refactor required forward visibility)
    3) New extern decl: hir_builder_emit_awaited_call_tail_c

  Python/jit/hir/builder_emit_c.c:
    NEW hir_builder_emit_awaited_call_tail_c (~50 lines):
      A5 alloc out + 2 blocks (await_block + post_await_block)
      A5 dispatch_eager_coro_result (chains to push 55 C function)
      A6 tc->block = await_block
      A7 get_awaitable using pre-computed error flags (chains to push 56)
      A8 load_const using pre-computed oparg + caller-passed code
      A9 yield_from_method (chains to push 53)
      A10 phx_tc_emit branch to post_await_block
      A11 tc->block = post_await_block

PTE-trial invariant inventory verification per theologian [chat L1928]:
  12 invariants A1-A12 + 4 pitfalls PA-PD.
  PA: JIT_CHECK fires C++-side BEFORE C call ✓
  PB: iterator state stays C++-side; only ints + pointers cross boundary ✓
  PC: tc->block reassignment in C body (A6 + A11) ✓
  PD: code passed as PyCodeObject* (not void*) — preserves emitGetAwaitable
      port's PA invariant ✓

PTE TRIAL ROUND 2 FEEDBACK: A4 IF/THEN structure made
'JIT_CHECK MUST fire BEFORE C call' visually unambiguous. PD pitfall
on code_ typing caught at design time. Two empirical wins
(round 1: PD.a/PD.b distinction, round 2: A4 + PD).

Bridge spec (8 args, ratified by theologian [chat L1931]):
  void hir_builder_emit_awaited_call_tail_c(
      PhxTranslationContext* tc, void* func, void* builder,
      PyCodeObject* code, int code_flags,
      int get_awaitable_error_aenter, int get_awaitable_error_aexit,
      int load_const_oparg);

testkeeper x86_64 compile-only PASS verified pre-commit at binary
timestamp 1776878644 (chat 17:24Z). Iter 1 needed forward decl for
checkAsyncWithError; v2 cleaned.

Tier 5 milestone: 103/144 = 71.5% with PartialConversion-asterisk on
emitAnyCall (await-tail in C, opcode-switch + INVOKE_* still C++).

Pre-push 61 gate ahead (per pythia python#77 python#3 + supervisor [chat L1939]):
  testkeeper authors call-shape falsifier extension exercising
  emitCallExceptionHandler D1-D3 invariants (theologian spec [chat L1942]:
  3 tests covering function-call-in-try + closure-LOAD_DEREF +
  unmatched-exception-deopt). Lands as separate commit before
  Tier 5 close push.

Authorization chain:
  - theologian PTE pre-audit + design lean (a, but generalist chose b): chat L1928
  - bridge spec ratification: chat L1931
  - supervisor concurrence on (B) PartialConversion: chat L1930
  - testkeeper x86_64 compile PASS: chat L1944
SonicField added a commit to SonicField/cpython that referenced this pull request Apr 22, 2026
@SonicField
test: call-shape falsifier extension for emitCallExceptionHandler D1-D3
a642405
Per pythia python#77 python#3 [chat L1937] gap + supervisor [chat L1939] authorization +
theologian [chat L1942] spec: extend test_phoenix_jit_inline_except_closure.py
with TestJitCallExceptionHandler class covering 3 tests that exercise the
emitCallExceptionHandler unique invariants (D1-D3) NOT covered by the
existing inline-except (BINARY_SUBSCR_DICT) tests.

GAP CONTEXT: push 60 (9630005) landed emitCallExceptionHandler with
shared-helper design — D1-D3 unique invariants ride only the shared
P2+P3+P4 helper through the closure-LOAD_DEREF inline-except falsifier.
Call-shape (function-call-in-try) was empirically untested at push 60.
This falsifier closes that coverage gap retroactively.

  Lib/test/test_phoenix_jit_inline_except_closure.py:
    +135 lines, new class TestJitCallExceptionHandler with 3 tests:
    - C1 test_call_in_try_simple_except: function-call-in-try, ValueError
      matched + return from except. Exercises D1 (setSuppressExceptionDeopt
      + pop result pre-call) + D3 (RefineType + result push on OK path).
    - C2 test_call_in_try_with_closure_load_deref: function-call-in-try,
      LOAD_DEREF on closure variable in except body. Exercises D1-D3 +
      PA (D-1774910012 prev_exc Py_None placeholder under
      emitCallExceptionHandler entry).
    - C3 test_call_in_try_deopt_path: function-call-in-try, unmatched
      exception (TypeError vs except ValueError). Exercises D2 (DeoptTC
      zero re-push, no left/right context — call-handler doesn't have
      left/right unlike inline-match).

EXISTING TESTS PRESERVED unchanged:
  TestJitInlineExceptClosure (3 tests) — D-1774910012 PA invariant
    via inline-except path, retained as the original falsifier.

EMPIRICAL VALIDATION RESULT (testkeeper [chat L1946]):
  Run on push 60 binary 9630005 (ARM64 pydebug):
    6/6 PASS, OK, 0.177s, EXIT=0, NO core dump.
  All D1-D3 invariants empirically validated; PA preserved across both
  call-handler and inline-match entry paths.

PYTHIA python#77 python#3 SUBSTANCE CLOSED:
  D1-D3 unique invariants now empirically exercised, not only ride-along
  through shared helper. Falsifier-pre-port discipline restored for
  emitCallExceptionHandler (regression test exists post-port; ideal would
  have been pre-port but supervisor [chat L1939] accepted post-port
  retroactive validation as remediation).

Bundled with push 61 (b28b512 emitAnyCall PartialConversion, Tier 5
close) per testkeeper [chat L1946] (a) sequencing — single gate cycle,
single push, no separate gate ceremony for .py-only change.

Authorization chain:
  - pythia python#77 python#3: chat L1937 (gap surfaced)
  - supervisor authorization: chat L1939
  - theologian spec: chat L1942
  - testkeeper draft + push-60-binary validation: chat L1946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@berkerpeksag berkerpeksag berkerpeksag approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Mariatta @berkerpeksag @the-knights-who-say-ni @ilevkivskyi
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.