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-29567: Allow argparse to be used in setup.py by yan12125 · Pull Request #119 · python/cpython

Conversation

@yan12125

@yan12125 yan12125 commented Feb 15, 2017

Copy link
Copy Markdown

https://bugs.python.org/issue29567

Sorry, something went wrong.

Uh oh!

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

All reactions
Yen Chi Hsuan
bpo-29567: Allow argparse to be used in setup.py
168811e
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 15, 2017
@brettcannon

brettcannon commented Feb 15, 2017

Copy link
Copy Markdown
Member

Thanks for the pR, @yan12125 , but since this change adds a local import I would rather not accept it on its own but only as part of a larger patch that necessitated the actual change.

All reactions

Sorry, something went wrong.

Uh oh!

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

@brettcannon brettcannon closed this Feb 15, 2017
@yan12125
yan12125 deleted the make-argparse-pure-python branch February 16, 2017 09:48
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#119: Make STACKLESS_PACK()/STACKLESS_UNPACK() recursion …
2b3df1e
…and thread safe

Store the return value during stack unwinding in the thread state instead of a global variable.
Change the macro STACKLESS_POSSIBLE() to disable nested stack unwinding.

https://bitbucket.org/stackless-dev/stackless/issues/119
(grafted from 7af03ffcfce3b00ad657ea957a7c1322b991fe6b)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#119)
3acd739
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#119)
6824a28
@gvanrossum gvanrossum mentioned this pull request Aug 22, 2023
heap-use-after-free in _PyFunction_LookupByVersion #108253
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
SonicField added a commit to SonicField/cpython that referenced this pull request Apr 24, 2026
@SonicField
Tier 8 SECOND-PILOT Phase B: block_map_.bc_blocks → PhxBcBlockArray
4145fe3
Closes the SECOND pilot. Migrates the BasicBlock* → BytecodeInstructionBlock
mapping from std::unordered_map to a dense array indexed by BasicBlock::id,
exploiting the production-validated invariant that ids are
allocation-monotonic from 0 (cfg.h:139-144 `id = next_block_id_++`). Choice
of B-γ (dense array) over B-α (parallel hash) per theologian 11:13:21Z:
no hash, no collisions, no resize-on-load-factor — three classes of bug
B-α can have, B-γ cannot. Pattern is new (id-indexed dense array vs hash)
but well-suited to the data shape.

Combined with Phase A (push 39, 72bb8e9), block_map_ is ENTIRELY
migrated to PhxHirBuilderState. The wrapping BlockMap C++ struct + the
block_map_ C++ field are DELETED.

Net bridges: 0 (no new bridges; bc_blocks had zero C-side callers per
inventory). Per theologian 11:19:42Z: §5 python#11 prevents UNCONTROLLED bridge
growth, so a net-0 pilot is neither violation nor satisfaction — Phase B's
substantive deliverable is std::unordered_map elimination, which advances
the ZERO-C++ terminal goal equivalent to bridge subtraction.

PyCodeObject* code is constant per-compile and lives on
PhxHirBuilderState.code (set in HIRBuilder ctor), so it is not stored
per-array-slot — saves 8 bytes per block.

Three invariants asserted (theologian 11:13:21Z):
- I1 (JIT_DCHECK at createBlocks return): bc_block_array.count ==
  block_map_phx.count. The two are populated in lockstep on every loop
  iteration; counts must agree.
- I2 (JIT_DCHECK at buildHIRImpl read): tc.block->id <
  bc_block_array.count. Catches HIR-pass-created blocks accidentally
  being looked up; should never happen but assert it.
- I3 (documented, not asserted): BasicBlock::id is read-only post-
  allocation. No HIR pass renumbers ids; if any future pass does, B-γ
  is wrong. RPO and other passes traverse, never renumber. Runtime
  sentinel would defeat the dense-array O(1) win.

Lazy-grow uses single-realloc max(old_cap*2, block_id+1) per theologian
11:19:42Z verification (block_id=1000 with old_cap=16 is 1 alloc, not
7 doublings).

CALLER REWRITES (2 functional sites):
- builder.cpp createBlocks: writes both state_.block_map_phx (Phase A)
  and state_.bc_block_array_phx (Phase B) in lockstep. Return type
  void (was BlockMap).
- builder.cpp buildHIRImpl: read site reconstructs BytecodeInstructionBlock
  value from {code_, BCIndex{start}, BCIndex{end}} using array entry +
  state_.code (constant per-compile). Subsequent .begin/.end/iteration
  works on the local value identically to the old map-reference.

UNIT TESTS: +6 PhxBcBlockArray tests (init/insert+at/lazy-grow/n300/
clear/overwrite-same-id) appended to test_phx_block_map.c. Existing 8
PhxBlockMap tests unchanged.

GATE COVERAGE: the existing block_map_resize_chain wiring fixture (Phase A
push 39) exercises createBlocks which now populates BOTH structures in
lockstep, so PhxBcBlockArray growth is implicitly covered. Pythia python#119
(a) n=294 coverage extension is a separate followup commit (theologian
11:20:24Z + supervisor 11:20:43Z DEFERRED — sequence-isolated, not
bundled).

Auth chain: theologian B-γ pick 11:13:21Z + patch-shape APPROVE 11:19:42Z
(2 verifications applied at 11:20:15Z); supervisor 11:13:46Z + 11:18:54Z
+ 11:20:43Z; shepard sequence-isolation 11:11:59Z; librarian §5 python#11
non-violation framing 11:15:58Z.
SonicField added a commit to SonicField/cpython that referenced this pull request Apr 24, 2026
@SonicField
gate_phoenix: extend wiring fixture to n>=294 (block_map_n294_chain)
154997b
Closes pythia python#119 (a) PhxBlockMap hash-clustering coverage gap deferred
from Phase A push 39 (theologian 11:20:24Z + supervisor 11:20:43Z DEFER:
separate from Phase B for clean revert boundary; sequence-isolated per
shepard 11:11:59Z).

Gap: the previous block_map_resize_chain (10 if-return arms,
~25 block_starts) trips PhxBlockMap_resize at insert python#12 but does not
exercise the 5 sequential resizes (16->32->64->128->256->512) that
re._parser:Tokenizer.__next at 294 blocks drives in production
(D2 measurement 2026-04-24).

Fix: add block_map_n294_chain — 110-arm if-return chain (~330 block_starts)
generated via exec to keep the source compact. force_compile must succeed
across n=0/54/109/200 (3 in-range hits + 1 default-arm miss); proves
Knuth multiplicative h=key*2654435761u clusters acceptably at production-
scale BCOffset density.

NO production code change. Pure test/fixture extension. Pre-commit
discipline satisfied via testkeeper bash -n syntax lint + diff-scope
confirmation (testkeeper 11:33:43Z): no C/C++ source touched, Phase B
binary 4145fe3 remains current.

Auth chain: theologian patch-shape APPROVE 11:33:03Z; testkeeper pre-
commit lint PASS 11:33:43Z.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

3 participants

@yan12125 @brettcannon @the-knights-who-say-ni
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.