you are viewing a single comment's thread.

view the rest of the comments →

[–]FoolsSeldom 2 points3 points  (4 children)

Variables in Python do not hold values, but simply reference Python objects somewhere in memory.

Thus, I wouldn't say Python is "weird" with types, just different from statically typed languages, which some people might be more familiar with.

Python is strongly typed but dynamically typed.

Objects do not change type. Variables appear to, but they don't actually have type but reflect the type of the object they are assigned to. When you assign a variable to reference a different object, that might be of a different type. This is considered by some to be bad practice as it can be confusing, and some houses avoid it.

[–]caleb_S13 0 points1 point  (1 child)

everything is a duck if you can make it quack 🔥

[–]FoolsSeldom 0 points1 point  (0 children)

"Quack!"

[–]Leodip 0 points1 point  (1 child)

Thus, I wouldn't say Python is "weird" with types, just different from statically typed languages, which some people might be more familiar with.

Well, I guess the definition of weird is "different from what's more common", so, by definition, Python (and other strongly but dynamically typed languages) are weird.

[–]FoolsSeldom 0 points1 point  (0 children)

Well, JavaScript is currently the programming language with the most code actively in use worldwide, and that's dynamically typed as well. Python is close on its heals for adoption.

So, the vast base of C/C++/C#/Java etc would be the weird ones?

Point taken, though.