Looking for resources for making the jump from Java to Python easier and more productive
bruno at modulix
onurb at xiludom.gro
Mon Apr 24 07:16:30 EDT 2006
Lawrence D'Oliveiro wrote:
> In article <1145691651.385835.298600 at u72g2000cwu.googlegroups.com>,
> "ToddLMorgan" <ToddLMorgan at gmail.com> wrote:
>
>
>>I'm looking for the common types of mistakes that say a Java/C# or
>>even C++ developer may commonly make.
>
>
> Using subclassing when you don't have to. For instance, you might have a
> Java method which takes an argument of type java.io.OutputStream to
> which it writes. You might translate this to a Python method to which
> you are careful to only pass instances of subclasses of file objects.
> But in fact there is no necessity for this: you are free to pass any
> object which has appropriate members.
>
> I suppose this is an instance of the more general rule: "using OO when
> you don't have to".
Lawrence, I'm afraid you're confusing OO with "statically-typed
class-based". FWIW, dynamic typing is part of OO since Smalltalk.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"
More information about the Python-list
mailing list