Skip to content

Fix dict.fromkeys to return correct type - #3585

Merged
youknowone merged 1 commit into
RustPython:mainfrom
dieterplex:fixtestuserdict
Mar 30, 2022
Merged

youknowone merged 1 commit into
RustPython:mainfrom
dieterplex:fixtestuserdict

Conversation

@dieterplex

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread Lib/test/test_dict.py
@dieterplex

Copy link
Copy Markdown
Contributor Author

Now UserDict related assertions in test_fromkeys() can be passed.
But still unable to pass baddict# checks.
Also observed that __init__ and __setitem__ magics seems not invoked when dict creation.

Comment thread vm/src/builtins/dict.rs Outdated
@dieterplex
dieterplex force-pushed the fixtestuserdict branch 2 times, most recently from db9dd9b to 1b7a3fe Compare March 29, 2022 15:30
@dieterplex
dieterplex marked this pull request as ready for review March 29, 2022 16:08
@fanninpm

Copy link
Copy Markdown
Contributor

@youknowone Windows failure is because Chocolatey couldn't download openssl. Can we rerun just that job?

Based on CPython implementation, dictobject.c, construct the new
object with type and call corresponding setitem method.
@dieterplex

Copy link
Copy Markdown
Contributor Author

Update commit message to trigger rerun.

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks great, thank you!

@youknowone
youknowone merged commit 7d7e9c8 into RustPython:main Mar 30, 2022
@dieterplex
dieterplex deleted the fixtestuserdict branch March 30, 2022 04:46
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