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

Replace dict.update with new implementation #570

Open
inoas opened this issue Apr 24, 2024 · 5 comments
Open

Replace dict.update with new implementation #570

inoas opened this issue Apr 24, 2024 · 5 comments

Comments

@inoas
Copy link
Contributor

inoas commented Apr 24, 2024

  • rename dict.update to dict.upsert
  • deprecate dict.update
  • 2.0 let dict.update return Result and Error if no key found
@inoas
Copy link
Contributor Author

inoas commented May 22, 2024

Is there interset in this, then I'd create a PR.

@lpil
Copy link
Member

lpil commented May 23, 2024

Let's do it!

  1. Deprecate dict.update and introduce dict.upsert
  2. Remove dict.update
  3. Introduce the new dict.update

@lpil lpil changed the title rename dict.update to dict.upsert? rename dict.update to dict.upsert May 23, 2024
@mooreryan
Copy link
Contributor

Is there still any interest in a change/alter function as in #599?

@lpil lpil changed the title rename dict.update to dict.upsert Replace dict.update with new implementation May 29, 2024
@lpil
Copy link
Member

lpil commented May 29, 2024

That's what the new dict.update is to be

@inoas
Copy link
Contributor Author

inoas commented May 29, 2024

@lpil as short as possible:

  1. Add dict.change? #599 seems to be about a function that either updates or removes or adds values to a dict
  2. while my PR stdlib 0.40: reuse dict.update #610 is a simple change to the old update to return a Result and simplfy the apply function at the same time.

I do not want to steal anyones opportunity here and am happy to do whatever consensus arrises or whatever the core team decides.

I like all three: the new upsert, the new update and the proposed change/alter (last has the highest complexity to use however)

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

No branches or pull requests

3 participants