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
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
"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
__
"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
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
>> 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
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
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
> 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
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
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.
>
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 ):
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 = ''
>
"""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
class Item ( object ):
def __init__( self ):
self._FullName = ''
self._Recovery = 0
self._Exporter = SimpleItemExporter (); # Don't
understand
Bummer, I was hoping to consider myself at the tip of intermediate
python programming ...
This is the first time I h
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 (); # Don't
understand
# 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
17 matches
Mail list logo