Skip to content
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.

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

Change pop! for LittleDict behavior #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Change pop! for LittleDict behavior #143

wants to merge 1 commit into from

Conversation

fingolfin
Copy link
Contributor

  • now there is a 'default' argument just like for Dict
  • if no default is provided and the key is not found it now throws an error as specified in the pop! docstring and also matching what Dict and OrderedDict do. If anyone needs to adjust existing code that relies on pop! not throwing, they can either provide a default value, or use delete! (which returns the dictionary and does not throw if the key is not present).

Closely based on PR #59 with a few minor tweaks.

Resolves #61

But beware, this may break some existing code, so I am marking it as "breaking" and putting it onto the 2.0.0 milestone.

- now there is a 'default' argument just like for Dict
- if no default is provided and the key is not found it now
  throws an error as specified in the pop! docstring and also
  as Dict and OrderedDict do
@fingolfin fingolfin added the breaking Change breaks behavior and so needs to go into a major release label Nov 25, 2024
@fingolfin fingolfin added this to the v2.0.0 milestone Nov 25, 2024
@fingolfin fingolfin mentioned this pull request Nov 26, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Change breaks behavior and so needs to go into a major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LittleDict / OrderedDict pop! consistency
1 participant