Skip to content

Conversation

@friendlymatthew
Copy link
Member

This PR adds support for the del statement on subscripted objects, which enable deletion of list elements and dict entries through the del foo['bar'] syntax

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 23, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing py-delitem (2a21db6) with main (7909646)

Summary

✅ 11 untouched benchmarks

@friendlymatthew friendlymatthew force-pushed the py-delitem branch 2 times, most recently from 66ff161 to d05cac5 Compare January 23, 2026 05:36
Comment on lines +190 to +194
let mask = index >> 63;
let normalized_index = index + (mask & len);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very harmless and branchless way of doing:

let normalized_index = if index < 0 { index + len } else { index };

The idea being:

  • if index < 0, then mask is -1 (all bits set)
  • if index >= 0, mask = 0, so we add 0

@friendlymatthew friendlymatthew force-pushed the py-delitem branch 6 times, most recently from f290615 to 3f227be Compare January 23, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants