Re: [Tutor] Here's something to talk about

2009-04-16 Thread Ricardo Aráoz
Weidner, Ronald wrote: > One of your points represents a great opportunity to make mine. Suppose > this code is several years old. Now we have a new requirement that > states we need to work with the data as you described above. How > much of the existing code would you have to change to make th

Re: [Tutor] Here's something to talk about

2009-04-15 Thread Paul McGuire
Ronald - I really encourage you to try to embrace some of the basic Python idioms as part of your Java->Python journey: 1. Iterators for item in list_of_items: # do something with item Is all that is needed to visit each item in a Python list. Your verbose MoveFirst, MoveNext, if more <> N

Re: [Tutor] Here's something to talk about (Weidner, Ronald)

2009-04-15 Thread Alan Gauld
"Emile van Sebille" wrote Redundant, yes; syntax error, no. IIRC, semi-colons are optional line terminators. statement terminators I think. ie you can have several statements on a line by separating with semicolons: x=5; print x+2 7 Alan G __

Re: [Tutor] Here's something to talk about

2009-04-15 Thread Alan Gauld
"Weidner, Ronald" wrote # This code is posted for the purpose of conversation. If it is of some # value to someone that would be great. But what I hope is that the code # sparks conversations about what I did in this code and why I did it. Since # the list seems thick with OOP questions at

Re: [Tutor] Here's something to talk about

2009-04-15 Thread Weidner, Ronald
1. Python is not Java (see Philip Eby's blog entry http://dirtsimple.org/2004/12/python-is-not-java.html). Let go of your concepts that only Items can go into an ItemCollection - Python already has some perfectly good collection builtins. Instead of writing a custom ItemCollection, why not write

Re: [Tutor] Here's something to talk about

2009-04-15 Thread wesley chun
>> i think it's a common style guideline in multiple >> languages i'm familiar with (other than Python) to Capitalize class >> names but keep variables, functions, and methods all lowered. > > In most cases I know, class names are capitalized, while func and method > names are camel-cased: >   Thi

Re: [Tutor] Here's something to talk about

2009-04-15 Thread spir
Le Wed, 15 Apr 2009 12:20:20 -0700, wesley chun s'exprima ainsi: > i think it's a common style guideline in multiple > languages i'm familiar with (other than Python) to Capitalize class > names but keep variables, functions, and methods all lowered. In most cases I know, class names are capital

Re: [Tutor] Here's something to talk about

2009-04-15 Thread Weidner, Ronald
I must confess I do not really understand your intent (a) with the code itself (b) with the fact of publishing it Maybe I have read it too fast. What I saw is an implementation of strict object interface, in the sense strictly separating the inner and outer parts of an object. Sure, this is an

Re: [Tutor] Here's something to talk about

2009-04-15 Thread wesley chun
> 1. Python is not Java although i agree with all 4 points that paul makes, this 1st one stands out the most. when i saw the code the first time, the immediate thought that came to my mind was, "This looks like Java code written with Python syntax." i thing the same functionality can be accomplish

Re: [Tutor] Here's something to talk about

2009-04-15 Thread Paul McGuire
1. Python is not Java (see Philip Eby's blog entry http://dirtsimple.org/2004/12/python-is-not-java.html). Let go of your concepts that only Items can go into an ItemCollection - Python already has some perfectly good collection builtins. Instead of writing a custom ItemCollection, why not write

Re: [Tutor] Here's something to talk about

2009-04-15 Thread spir
Le Wed, 15 Apr 2009 08:29:30 -0700, "Weidner, Ronald" s'exprima ainsi: > # This code is posted for the purpose of conversation. If it is of some > # value to someone that would be great. But what I hope is that the code > # sparks conversations about what I did in this code and why I did it. >

Re: [Tutor] Here's something to talk about (Weidner, Ronald)

2009-04-15 Thread Emile van Sebille
W W wrote: On Wed, Apr 15, 2009 at 12:27 PM, Carnell, James E mailto:jecarn...@saintfrancis.com>> wrote: Since # the list seems thick with OOP questions at the moment, I thought this might # be relevant. Digest and enjoy. class Item ( object ): def __init__( self ):

Re: [Tutor] Here's something to talk about (Weidner, Ronald)

2009-04-15 Thread W W
On Wed, Apr 15, 2009 at 12:27 PM, Carnell, James E < jecarn...@saintfrancis.com> wrote: > Since # the list seems thick with OOP questions at the moment, I thought > this might # be relevant. Digest and enjoy. > > class Item ( object ): > >def __init__( self ): >self._FullName = '' >

Re: [Tutor] Here's something to talk about (Weidner, Ronald)

2009-04-15 Thread Carnell, James E
"""But what I hope is that the code # sparks conversations about what I did in this code and why I did it.""" If anyone answers me thank you. really. Nevertheless, I am personally not pursuing to understand this code. Ronald Weidner left on vacation and won't be back until the 19th (I don't kno

Re: [Tutor] Here's something to talk about (Weidner, Ronald)

2009-04-15 Thread Weidner, Ronald
class Item ( object ): def __init__( self ): self._FullName = '' self._Recovery = 0 self._Exporter = SimpleItemExporter (); #

Re: [Tutor] Here's something to talk about (Weidner, Ronald)

2009-04-15 Thread Carnell, James E
Since # the list seems thick with OOP questions at the moment, I thought this might # be relevant. Digest and enjoy. class Item ( object ): def __init__( self ): self._FullName = '' self._Recovery = 0 self._Exporter = SimpleItemExporter (); #

[Tutor] Here's something to talk about

2009-04-15 Thread Weidner, Ronald
# This code is posted for the purpose of conversation. If it is of some # value to someone that would be great. But what I hope is that the code # sparks conversations about what I did in this code and why I did it. Since # the list seems thick with OOP questions at the moment, I thought this m