Re: A java hobbyist programmer learning python

2009-01-17 Thread elhombre
"Steven D'Aprano" wrote in message news:0182896d$0$8693$c3e8...@news.astraweb.com... On Sun, 18 Jan 2009 11:11:45 +1000, elhombre wrote: Hello, below is my first fragment of working python code. As you can see it is very java like as that is all I know. Is this the right

Re: A java hobbyist programmer learning python

2009-01-17 Thread elhombre
"John Machin" wrote in message news:5d2c588a-9b01-4a85-85b2-b132754e6...@o40g2000prn.googlegroups.com... On Jan 18, 12:11 pm, "elhombre" wrote: Hello, below is my first fragment of working python code. As you can see it is very java like as that is all I know. Is this t

Re: A java hobbyist programmer learning python

2009-01-17 Thread elhombre
"Paul Rubin" wrote in message news:7xy6x9nzwd@ruckus.brouhaha.com... Chris Rebert writes: > class Calculator(): ... Delete the 3 Java-ish accessor methods; good Python style just uses the attributes directly (i.e. self.operator instead of self.getOperator

Re: A java hobbyist programmer learning python

2009-01-17 Thread elhombre
"Chris Rebert" wrote in message news:mailman.7468.1232242083.3487.python-l...@python.org... On Sat, Jan 17, 2009 at 5:11 PM, elhombre wrote: ... Rather than have a long if-elif-else chain like this, you can use a dictionary with functions as values. For example: def add(x, y):

A java hobbyist programmer learning python

2009-01-17 Thread elhombre
Hello, below is my first fragment of working python code. As you can see it is very java like as that is all I know. Is this the right approach to be taking? Should I be taking a different approach? Thanks in advance. import sys class Calculator(): def __init__(self): self.operator