strong/weak typing and pointers
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
>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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list