You could argue that since `{}` is also technically an empty set, `dict()` is more explicit.
> x
set()
Well now I know! However I still think the shared usage of curly braces for dicts and sets could be somewhat confusing.
> x = {1, 2, 3}
> x
{1, 2, 3}
(But maybe no one should listen to me because I don't know how to do code blocks on HN.)
{*()}
but I guess it is equivalent to set()
I've noticed this in python in another place f"{var}"
is the same as str(var)
there was some other place I can't recall also noticing that (at least my perception understands that) Python is trying to kill my code golf tendencies.That said, it's probably just my own superstition and of course it doesn't remove my premature optimization tendencies...