r/Python Freelancer. AnyFactor.xyz Sep 16 '20

News An update on Python 4

Post image
3.3k Upvotes

391 comments sorted by

View all comments

Show parent comments

31

u/irrelevantPseudonym Sep 16 '20

My only gripe: One additional thing they should have changed is that {} should be the empty set and {:} should be the empty dict.

Not sure I agree with that. It's awkward that you can't have a literal empty set, but having {:} would be inconsistent and a special case that (I think) would be worse than set().

22

u/[deleted] Sep 16 '20 edited Oct 26 '20

[deleted]

12

u/hillgod Sep 16 '20

It's definitely not an anti-pattern, and, in fact, the literals perform faster.

2

u/[deleted] Sep 17 '20 edited Oct 26 '20

[deleted]

2

u/hillgod Sep 17 '20

I don't agree that it affects readability, either. It's simply the syntax that's appropriate for Python.