Objects in Python
Mark Lawrence
breamoreboy at yahoo.co.uk
Wed Aug 22 14:23:44 EDT 2012
On 22/08/2012 18:46, lipska the kat wrote:
> On 22/08/12 18:01, Terry Reedy wrote:
>> On 8/22/2012 10:59 AM, lipska the kat wrote:
>>
>>> There is no real enforced concept of information hiding, no binding of
>>> type to variable in fact no concept of typing at all as far as I can
>>> see.
>>
>> Given that type(valid_name) always returns a type(class), that is a
>> slightly strange statement.
>
> [snip]
>
> Well I'm a beginner so I'm allowed to make strange statements.
> However I don't think it's that strange and here's why.
>
> If, in a language, I find I am able to say
>
> a = 1
>
> then later, in the same scope I can say
>
> a = "foo"
>
> then later again in the same scope I can say
>
> a = ([1,2,3], "xyz", True)
>
> then, and I may be missing something here, to me, that doesn't say
> 'strongly typed' that says 'no typing constraints whatsoever'
>
> If you can show me a 'type' that cannot be assigned to
>
> a
>
> in the same scope then I would be most interested to know, I haven't
> found one yet.
You've said nothing above except that any object you like can be bound
to a Python name. The name 'a' is never used. What happens when you
actually do something with the object that you've bound to 'a'?
>
> We need to separate out the 'view' from the 'implementation' here.
> Most developers I know, if looking at the code and without the possibly
> dubious benefit of knowing that in Python 'everything is an object'
> would not call this 'strong typing'
I really despair that after ten years of using Python people still seem
to be incapable of distinguishing strong, static, weak and dynamic
typing. Not that it's a specific Python problem of course, just that I
always get to read about it here.
>
> Once again, this is not a criticism, it's an observation
>
> It is OK to to make (possibly erroneous) observations isn't it?
Not if undoes concepts that computer scientists have patiently been
trying to explain for years.
>
> Thanks for taking the time to reply.
>
> lipska
>
--
Cheers.
Mark Lawrence.
More information about the Python-list
mailing list