0

From Python in a Nutshell:

In Python, a variable or other reference has no intrinsic type. The object to which a reference is bound at a given time always has a type, but a given reference may be bound to objects of various types in the course of the program’s execution.

In Java and C#, where references are also used to refer to objects, do references have types?

If yes,

  • what is the reason for that difference between Java/C# and Python?
  • What is the consequence of the difference?

Thanks.

  • I'm voting to close this question as off-topic because a question about the design decisions in programming languages seems to be more appropriate for cs.stackexchange.com. – Barmar Oct 02 '17 at 20:28
  • 2
    https://nedbatchelder.com/text/names1.html – chepner Oct 02 '17 at 20:30
  • What chepner said. Also see [Other languages have "variables", Python has "names"](http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#other-languages-have-variables) – PM 2Ring Oct 02 '17 at 20:37
  • Yes, references have types in Java and C# because they're *statically typed* languages. It means that the type checking is performed during compilation. Python performs type checking during runtime, so it is a *dynamically typed* language. – Milack27 Oct 02 '17 at 20:38

0 Answers0