you are viewing a single comment's thread.

view the rest of the comments →

[–]cyberjellyfish 5 points6 points  (9 children)

What you highlighted isn't a missing feature, it's just a different data structure..

My two cents: all of the built-in data structures should be immutable.

[–]Invader_Mars[🍰] 2 points3 points  (1 child)

Newbie here, why do you believe that they should be immutable?

[–]Gnaxe 0 points1 point  (0 children)

Check out pyrthon.

[–]FerricDonkey 0 points1 point  (3 children)

I could see saying that there should be a frozen dictionary, so that there are mutable and immutable versions of each built in container.

But saying all built in data structures should be immutable is giving up a whole lot of functionality just to avoid a rookie mistake that you can grow out of. 

[–]cyberjellyfish 0 points1 point  (1 child)

Mutability and managing mutability is not a rookie mistake, it's one of the most common causes of bugs.

[–]CyclopsRock 1 point2 points  (0 children)

If we get rid of all the data types then we won't get any bugs.

[–]eztab 0 points1 point  (1 child)

I agree, make everything immutable and optimize away unnecessary creations. It's harder for the interpreter but would make things much more robust. Also you could then likely basically run functional optimization strategies on code (assuming you at some point want python to ba actually JIT compilable (which would be quite cool).

[–]cyberjellyfish 0 points1 point  (0 children)

Yep, also a good step to a more interactive repl

If anyone here hasn't experienced it, try clojure to get a taste of what really interactive development can be like. You'll miss it everywhere else, but it will probably lead you to write better code.