Skip to content

Conversation

coolreader18
Copy link
Member

e.g.

dict(a=2, b=3) == {'a': 2, 'b': 3}
dict({'a': 2, 'b': 3}, b=4) == {'a': 2, 'b': 4}
dict([('a', 2), ('b', 3)]) == {'a': 2, 'b': 3}

@windelbouwman
Copy link
Contributor

Nice!

required = [(_ty, Some(vm.ctx.type_type()))],
optional = [(dict_obj, None)]
);
let dict = vm.ctx.new_dict();
Copy link
Contributor

Choose a reason for hiding this comment

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

Here, we could potentially use _ty to support dict subclasses as well.

@windelbouwman windelbouwman merged commit 366f3e2 into RustPython:master Dec 22, 2018
@coolreader18 coolreader18 deleted the proper-dict branch December 22, 2018 18:01
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