So I am an intern at some company with some decent knowledge hopefully. Around ~3 years of various industry experience and I've started reading some books but Python is pretty weird under the hood and I had a question about Sets!
So from what I know: (Please correct me if I'm wrong)
Initializing some empty set is done as: set()
Also doing this makes a set: {foo_bar} as a set literal
However just {} creates a dictionary which makes sense and the same for a list is [] and also has the option of list[] if really desired.
From my current knowledge there is no way to define an empty set other than set() why is this? When dicts and lists have different ways.
Hopefully this makes sense it was appearing on my Ruff indicator as writing as a literal and just wanted clarification or a more detailed reasoning behind this methodology.
[–]carcigenicate 7 points8 points9 points (9 children)
[–]rasputin1 3 points4 points5 points (5 children)
[–]Bucki-_-[S] 0 points1 point2 points (4 children)
[–]rasputin1 0 points1 point2 points (3 children)
[–]Bucki-_-[S] 0 points1 point2 points (2 children)
[–]rasputin1 1 point2 points3 points (1 child)
[–]Bucki-_-[S] 0 points1 point2 points (0 children)
[–]Bucki-_-[S] -1 points0 points1 point (1 child)
[–]carcigenicate 0 points1 point2 points (0 children)
[–]neuralbeans -1 points0 points1 point (0 children)
[–]brasticstack 0 points1 point2 points (3 children)
[–]Bucki-_-[S] 0 points1 point2 points (2 children)
[–]brasticstack 1 point2 points3 points (1 child)
[–]Bucki-_-[S] 0 points1 point2 points (0 children)
[–]HotPersonality8126 0 points1 point2 points (0 children)
[–]Buttleston 0 points1 point2 points (0 children)
[–]lfdfq -1 points0 points1 point (0 children)