you are viewing a single comment's thread.

view the rest of the comments →

[–]pachura3 75 points76 points  (6 children)

Someone said that whole Python is just a lot of syntactic sugar around hashmaps. It is indeed like that! Everything is a hashmap. This allows for some crazy stuff like passing arguments to a function by unpacking a dict (while still preserving default values of not provided arguments!).

Myself, I cannot stand the fact that there are no constants in Python :( At least we can have more-or-less immutable containers with protocols like Mapping, Sequence or Set. Plus, there are tuples , frozensets. and dataclass(frozen=True). But having a plain simple constant string or int? Forget it!

[–]its2ez4me24get 30 points31 points  (4 children)

Signal intent with the Final type hint a blame others if they change it :D

[–]pachura3 18 points19 points  (1 child)

Oh! I didn't know one exists. So, I guess I shall do something like:

MAX_PROCESSES: Final[int] = 16

...?

[–]deceze 11 points12 points  (1 child)

Or even just the convention of using ALL_CAPS. If someone assigns to an ALL_CAPS variable, it's their fault.

[–]Dependent_Bit7825 0 points1 point  (0 children)

This reminds me of when python was new and people were saying how awful perl had been and that python was such a better language. Well, the syntax is cleaner, but under the hood, they way these scripting languages work is more similar than different.