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-29453: Remove reference to undefined dictionary ordering in Tutorial by DimitrisJim · Pull Request #140 · python/cpython

Conversation

@DimitrisJim

@DimitrisJim DimitrisJim commented Feb 16, 2017 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

As of Python 3.6 **kwargs are ordered, thus, remove the paragraph stating that
ordering is undefined and change snippet to remove the unnecessary sorted call.

Only issue that might need addressing as raised on the tracker is, if it is worth to mention that the output corresponds to the order of passed keyword arguments.

(Though this was already present with a patch on b.p.o I decided to turn it in a pull request since, I believe, it makes it easier to check and apply now that things are on Github)

Sorry, something went wrong.

Uh oh!

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

All reactions
@DimitrisJim
bpo-29453: Remove reference to undefined dictionary ordering in Tutorial
2b7cd22
As of Python 3.6 **kwargs are ordered, thus, remove the paragraph stating that
ordering is undefined and change snippet to remove the unecessary sorted call.
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 16, 2017
@serhiy-storchaka serhiy-storchaka added the docs Documentation in the Doc dir label Feb 18, 2017
@DimitrisJim
Add sentence mentioning guaranteed output order of kwargs
b565db5
@DimitrisJim

DimitrisJim commented Feb 18, 2017

Copy link
Copy Markdown
Contributor Author

Added a sentence mentioning the guaranteed output order. Should I also make a PR for 3.6?

All reactions

Sorry, something went wrong.

Uh oh!

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

@Mariatta

Mariatta commented Feb 19, 2017

Copy link
Copy Markdown
Member

Thanks @DimitrisJim
You don't have to create a separate PR for 3.6, core devs (in this case me) will do the backport :)
I'm travelling now for a conference, and will look into this after I'm back :)

All reactions

Sorry, something went wrong.

Uh oh!

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

@Mariatta Mariatta self-assigned this Feb 19, 2017
@Mariatta

Mariatta commented Feb 19, 2017

Copy link
Copy Markdown
Member

Assigning this to myself per request by @rhettinger http://bugs.python.org/issue29453

All reactions

Sorry, something went wrong.

Uh oh!

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

@DimitrisJim

DimitrisJim commented Feb 19, 2017

Copy link
Copy Markdown
Contributor Author

Thanks, @Mariatta!

All reactions

Sorry, something went wrong.

Uh oh!

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

@Mariatta Mariatta added the needs backport to 3.6 label Feb 21, 2017
Mariatta
Mariatta approved these changes Feb 21, 2017
View reviewed changes
@Mariatta
Mariatta merged commit 32e8f9b into python:master Feb 21, 2017
Mariatta pushed a commit to Mariatta/cpython that referenced this pull request Feb 21, 2017
@DimitrisJim @Mariatta
bpo-29453: Remove reference to undefined dictionary ordering in Tutor…
966cd11
…ial (pythonGH-140)

As of Python 3.6 **kwargs are ordered, thus, remove the paragraph stating that
ordering is undefined and change snippet to remove the unecessary sorted call.

* Add sentence mentioning guaranteed output order of kwargs

(cherry picked from commit 32e8f9b)
@Mariatta Mariatta removed the needs backport to 3.6 label Feb 21, 2017
Mariatta added a commit that referenced this pull request Feb 21, 2017
@Mariatta
bpo-29453: Remove reference to undefined dictionary ordering in Tutor…
9b49133
…ial (GH-140) (#208)

As of Python 3.6 **kwargs are ordered, thus, remove the paragraph stating that
ordering is undefined and change snippet to remove the unecessary sorted call.

* Add sentence mentioning guaranteed output order of kwargs

(cherry picked from commit 32e8f9b)
@DimitrisJim
DimitrisJim deleted the control_flow_dict branch March 27, 2017 20:55
akruis pushed a commit to akruis/cpython that referenced this pull request Oct 29, 2017
Anselm Kruis
Stackless issue python#140: Fix compiler warnings
3461ccf
- Initialize variable 'len' in function unwrap_frame_arg().
- Assign to '*valid' in function slp_find_execname().
- Disable GCC warning -Waddress in macro TASKLET_SETVAL(task, val).
- Update Stackless/changelog.txt for issues python#138, python#140
akruis pushed a commit to akruis/cpython that referenced this pull request Nov 7, 2017
Anselm Kruis
Stackless issue python#140: Fix compiler warnings
62d3e0f
- fix a warning about an unused expression result in ceval.c
- fix a warning about a non literal NULL-pointer initialization in
prickelpit.c
(cherry picked from commit 2b68ad3)
akruis pushed a commit to akruis/cpython that referenced this pull request Nov 7, 2017
Anselm Kruis
Stackless issue python#140: Fix compiler warnings
2715b0c
- remove an unused declaration.

(cherry picked from commit e20d523)
akruis pushed a commit to akruis/cpython that referenced this pull request Nov 7, 2017
Anselm Kruis
Stackless issue python#140: Fix compiler warnings
324ce7c
Fix warnings emitted by gcc 7.2.
- ceval.c: '*' in boolean context, suggest '&&' instead.
- stacklessmodule.c: a misleading indentation

(cherry picked from commit c51072e)
akruis pushed a commit to akruis/cpython that referenced this pull request Mar 25, 2018
Anselm Kruis
Stackless issue python#140: Fix compiler warnings
2b68ad3
- fix a warning about an unused expression result in ceval.c
- fix a warning about a non literal NULL-pointer initialization in
prickelpit.c
akruis pushed a commit to akruis/cpython that referenced this pull request Mar 25, 2018
Anselm Kruis
Stackless issue python#140: Fix compiler warnings
e20d523
- remove an unused declaration.
akruis pushed a commit to akruis/cpython that referenced this pull request Mar 25, 2018
Anselm Kruis
Stackless issue python#140: Fix compiler warnings
c51072e
Fix warnings emitted by gcc 7.2.
- ceval.c: '*' in boolean context, suggest '&&' instead.
- stacklessmodule.c: a misleading indentation
@Mariatta Mariatta removed their assignment Jun 10, 2018
akruis pushed a commit to akruis/cpython that referenced this pull request Jun 19, 2018
Anselm Kruis
Stackless issue python#140: Fix compiler warnings
94e7bcf
- Assign to '*valid' in function slp_find_execname().
- Disable GCC warning -Waddress in macro TASKLET_SETVAL(task, val).
- Update Stackless/changelog.txt for issues python#138, python#140

(cherry picked from commit 3461ccf)
akruis pushed a commit to akruis/cpython that referenced this pull request Jun 19, 2018
Anselm Kruis
Stackless issue python#140: Fix compiler warnings
ff935a3
- remove an unused declaration.
akruis pushed a commit to akruis/cpython that referenced this pull request Jun 19, 2018
Anselm Kruis
Stackless issue python#140: Fix compiler warnings
0852f81
Fix warnings emitted by gcc 7.2.
- stacklessmodule.c: a misleading indentation

(cherry picked from commit c51072e)
jaraco pushed a commit that referenced this pull request Dec 2, 2022
@pyup-bot @Mariatta
Update aiohttp from 3.4.0 to 3.4.1 (#140)
4170abd
SonicField added a commit to SonicField/cpython that referenced this pull request Apr 25, 2026
@SonicField
builder: emitAnyCall full PURE conversion (W27c) + Phase A.5 wrap
0810be4
Per supervisor 21:23:07Z + theologian 21:23:08Z + theologian P7 audit
20:53:51Z. Moves emitAnyCall from PARTIAL Cat-B to PURE-CONVERTED
(Phase 3D 98/100 → 99/100). One PARTIAL Cat-B remains: emitLoadMethodStatic
(blocked on VTableByteOffset wrapper, landed in push 58).

CHANGES:

C body (Python/jit/hir/builder_emit_c.c hir_builder_emit_any_call_c):
- New signature: drop call_kind/is_kw_arg/is_awaited/const_arg params;
  add opcode (raw int) and BcByteOffset base_offset (P5 wrapper).
- Move opcode→PhxCallKind switch into C body. CALL/CALL_FUNCTION_EX
  from Include/opcode.h; CALL_FUNCTION/_KW/CALL_KW/CALL_METHOD from
  Python/jit_common/opcode_stubs.h (stubbed >255 in 3.12 but kept for
  forward compat).
- INVOKE_FUNCTION/NATIVE/METHOD opcode constants local-#define'd in C
  body (209/216/185 from Python/jit_interp/3.12/cinder_opcode_ids.h).
  Local-define avoids pulling cinder_opcode.h which would shadow
  Include/opcode.h's BINARY_OP_ADD_INT and break BINARY_OP
  specialization #ifdef (per existing comment at builder_emit_c.c:30).
  Guarded with #ifndef so future direct cinder_opcode_ids.h include
  doesn't conflict.
- is_awaited hardcoded 0 for 3.12 with #if PY_VERSION_HEX guard +
  #error fallback for older Python (Phoenix targets 3.12 exclusively).
  Older-Python path would need C-side bc_it/bc_instr accessors (out-
  of-scope; covered by existing C++ stub history in git log).
- const_arg = PyTuple_GET_ITEM(code->co_consts, oparg) for INVOKE_*.
  Per HIRBuilder::constArg @ builder.cpp pre-conversion: borrowed ref,
  no GC trigger, no refcount. Lifetime = code object = compile duration.
  Theologian 20:53:51Z P7 audit confirmed safe to extract on C side.
- base_offset.v unwrap at the one boundary
  (hir_builder_emit_call_method_exception_handler_inline_c, raw-int API).

C++ stub (Python/jit/hir/builder.cpp HIRBuilder::emitAnyCall):
- Shrinks from 67 lines to 12 lines: pure type marshaling delegation.
- Wraps base_offset via bc_byte_offset_from_int factory (Phase A.5).
- Added bytecode_c.h include for BcByteOffset visibility.

P6 EXECUTION-PATH COVERAGE:
- PHX_CALL_KIND_CALL_METHOD (CALL/CALL_METHOD/CALL_KW): EXERCISED by
  test_exc_raise_catch (CALL ValueError(...)) + 4 W-2A-DISPATCH-COVERAGE
  sentinels (try/else, try/finally with raise, nested try, raise-in-handler)
  + 4 W-2B-RECONVERT sentinels (raise/catch, BINARY_SUBSCR_DICT-in-try,
  continue-in-loop, multi-except-in-loop) + test_multiple_exceptions_in_loop.
- PHX_CALL_KIND_CALL_EX (CALL_FUNCTION_EX): EXERCISED indirectly by any
  test using *args/**kwargs unpacking; covered by Phoenix CPython suite.
- PHX_CALL_KIND_VECTOR_CALL (CALL_FUNCTION/_KW): DEAD in 3.12 (stubbed
  >255). Switch case kept for forward compat with older Python builds.
- PHX_CALL_KIND_INVOKE_FUNCTION/NATIVE/METHOD: COVERAGE GAP. INVOKE_*
  opcodes are Cinder static-Python only; vanilla CPython 3.12 compiler
  does NOT emit them. Pure Python sentinel cannot exercise these
  branches without Cinder static-Python infrastructure (not available
  in this build per theologian 21:32:27Z + supervisor 21:32:42Z
  fallback). Conversion is mechanical (PyTuple_GET_ITEM extraction +
  delegate to existing emit functions); structural test exists at
  Lib/test/test_phoenix_partial_conversions.py:52. Execution-level
  coverage queued as W-CINDERX-INVOKE-COVERAGE workstream
  (cinderx_dev integration post-Phoenix-integration).

Phase 0' HIR-DIFF planned (theologian step 4): test_exc_raise_catch +
4 W-2A sentinels + Phoenix suite — pre/post conversion HIR comparison
to detect any divergence.

Verification pending: testkeeper rebuild + 30x all 8 W-2A+W-2B-RECONVERT
sentinels + 30x test_multiple_exceptions_in_loop + Phoenix suite +
ABBA + dual-arch.

Per supervisor 21:32:42Z (post pythia python#140 python#2): full 24-bench ABBA
between push 59 (this) and push 60 (emitLoadMethodStatic conversion)
— single-commit bisect window for cap-clock at 73 commits since last
24-bench (cbb9453 2026-04-23).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Mariatta Mariatta Mariatta approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

docs Documentation in the Doc dir

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

@DimitrisJim @Mariatta @serhiy-storchaka @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.