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 — Align set and dictionary view operation controls by youknowdot · Pull Request #9693 · RustPython/RustPython

Align set and dictionary view operation controls #9693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
youknowone merged 6 commits into RustPython:main from youknowdot:set-controls-parity-20261104
Nov 6, 2026

Uh oh!

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

Merged

Align set and dictionary view operation controls #9693

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit Hold shift + click to select a range
4d40ae7
Align set operand and hashing controls with CPython
youknowdot Nov 4, 2026
cb29554
Keep legacy dictionary deletion wrapper test-only
youknowdot Nov 4, 2026
52066f0
Align dictionary view and native copy controls
youknowdot Nov 4, 2026
3ad0432
Reuse set construction for dictionary view operands
youknowdot Nov 4, 2026
bb6a02e
Preserve intersection failure cleanup order
youknowdot Nov 4, 2026
d5b0314
Restore typed set predicate arguments
codex Nov 6, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

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

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

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

Diff view
Diff view
Prev Previous commit
Next Next commit
Reuse set construction for dictionary view operands
Assisted-by: OpenAI Codex:model version not exposed
  • Loading branch information

Uh oh!

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

@youknowdot @codex
youknowdot authored and codex committed Nov 6, 2026
commit 3ad04323411774db92d3ed67ec9b49b7b801bcae

Some comments aren't visible on the classic Files Changed page.

There are no files selected for viewing

7 changes: 3 additions & 4 deletions 7 crates/vm/src/builtins/dict.rs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2416,21 +2416,20 @@ impl AsSequence for PyDictValues {
}

fn dict_view_to_set(obj: &PyObject, vm: &VirtualMachine) -> PyResult<PySetInner> {
let mut source = obj;
if let Some(keys) = obj.downcast_ref::<PyDictKeys>() {
let dict = keys.dict();
if dict.as_object().class().is(vm.ctx.types.dict_type)
|| dict.as_object().class().is(vm.ctx.types.frozendict_type)
{
// Exact dictionary keys are already hashed. Subclasses instead
// go through the view iterator, including OrderedDict views.
let result = PySetInner::default();
result.merge_dict(dict.as_dict(), vm)?;
return Ok(result);
source = dict.as_object();
}
}
// Reflected operations can put a set on the left. Reuse the set
// constructor's native paths rather than calling an overridden iterator.
PySetInner::from_object(obj.to_owned(), vm)
PySetInner::from_object(source.to_owned(), vm)
}

fn set_inner_number_op<F>(a: &PyObject, b: &PyObject, f: F, vm: &VirtualMachine) -> PyResult
Expand Down
2 changes: 1 addition & 1 deletion 2 crates/vm/src/builtins/set.rs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ impl PySetInner {
Ok(())
}

pub(super) fn merge_dict(&self, dict: &PyDict, vm: &VirtualMachine) -> PyResult<()> {
fn merge_dict(&self, dict: &PyDict, vm: &VirtualMachine) -> PyResult<()> {
// Equality between colliding keys can change the source dictionary.
// Match the live _PyDict_Next traversal used by set_update_dict.
let mut position = 0;
Expand Down
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 01402520 — 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.