On 2/21/2018 3:15 AM, Antoon Pardon wrote:
On 21-02-18 06:18, Terry Reedy wrote:
On 2/20/2018 8:38 AM, Antoon Pardon wrote:
People praise the dynamic nature of Python here on this list and then
often enough seem to recoil when they see a piece of code really using
that dynamism.
...
When makes people recoil is abusing dynamism by needlessly rebinding a
name to objects of different specific type within a single block of code.
But that was what Steven was complaining about. The fact that in a static
language
He would need two names if he wanted a variable in a single block of code to be
first a number and then a string. At least that is how I understood him.
I am not a party to any dispute between you and Steven.
I intentionally inserted 'needlessly' in that comment to cover the
situation where a competent Python programmer has at least a plausible
reason for rebinding within a block. But in Python, this is rare
compared to the constant binding of parameters names to whatever
argument one passes.
Types indicate how to treat a particular object or, in some computer
languages, a block of memory. Declaring a type for a name that is
permanently attached to an information entity is an indirect way of
associating a type with the entity. If entities are tagged with their
type, then names need not be.
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list