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

refactor: Remove _dict_update #980

Merged
merged 2 commits into from
Nov 22, 2024
Merged

refactor: Remove _dict_update #980

merged 2 commits into from
Nov 22, 2024

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Nov 22, 2024

I think this function does exactly what a normal dict does if the first argument is a dict.

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.35%. Comparing base (6c28e65) to head (2cc7a84).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #980      +/-   ##
==========================================
- Coverage   87.36%   87.35%   -0.02%     
==========================================
  Files           9        9              
  Lines        4939     4935       -4     
==========================================
- Hits         4315     4311       -4     
  Misses        624      624              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

param/_utils.py Outdated
@@ -203,15 +203,6 @@ def _is_mutable_container(value):
return issubclass(type(value), MUTABLE_TYPES)
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated but this looks more correct to me

Suggested change
return issubclass(type(value), MUTABLE_TYPES)
return isinstance(value, MUTABLE_TYPES)

@@ -203,15 +203,6 @@ def _is_mutable_container(value):
return issubclass(type(value), MUTABLE_TYPES)


def _dict_update(dictionary, **kwargs):
Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't checked if any downstream uses this.

Copy link
Member Author

Choose a reason for hiding this comment

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

It does not look like we use this downstream.

@hoxbro hoxbro marked this pull request as ready for review November 22, 2024 11:18
Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

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

Seems fine to me, though I do always worry if I can't remember why it was done this way originally. Maybe some ancient issue with an earlier Python version?

@hoxbro
Copy link
Member Author

hoxbro commented Nov 22, 2024

Seems fine to me, though I do always worry if I can't remember why it was done this way originally. Maybe some ancient issue with an earlier Python version?

Either that, it was more complex at some point, or just forgetting that this is possible.

@hoxbro hoxbro merged commit 1868240 into main Nov 22, 2024
16 checks passed
@hoxbro hoxbro deleted the refactor_remove__update_dict branch November 22, 2024 16:06
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.

3 participants