![](https://secure.gravatar.com/avatar/72ee673975357d43d79069ac1cd6abda.jpg?s=120&d=mm&r=g)
April 1, 2019
9:43 p.m.
Paul Moore wrote:
now that Python has type inference, it should be possible for users to just type {} and have the interpreter work out which was intended from context.
Or have {} return an ambiguous object that turns into a dict or set depending on what is done to it. We could call it a quict (quantum dict). To support this, we would also have to add a third possible value for type bool:
x = {} isinstance(x, dict) Maybe isinstance(x, set) Maybe x['foo'] = 42 isinstance(x, dict) True isinstance(x, set) False
-- Greg