strong/weak typing and pointers

Michael Pyle pyle_michael at emc.com
Tue Nov 2 17:17:32 CET 2004


>> 
>> Strong types provide strong protection for data types as their
>> abstraction; weak types allow you to operate on data "behind the
>> wall of abstraction".  A Smalltalk programmer would say that
>> Python is more weakly typed than Smalltalk for user-defined types.
>
>Never used smalltalk, so help me with understanding this:
>Do you mean by that that python allows alteration of members 
>of an object,
>thus circumvening possible methods that should be used for 
>that? Or, to put
>it in an other way: do you consider the lack of a privacy 
>policy of members
>as "weak"?
>
>If this is the case: I personally wouldn't call that "weaker" 
>- python just
>allows for more default-messages to be accepted by an object - 
>if you want
>better privacy for your members, use slots and properties. But 
>this is of
>coures not totally safe - as it is not in java c++.
>

Perhaps he is refering to the ability to change the class of an instance at
runtime. If you can't do that in Smalltalk (all other things being equal),
I'd say that would indicate weaker typing.

--mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20041102/399aa617/attachment.html>


More information about the Python-list mailing list