Message from discussion
ten small Python programs
Path: g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!transit2.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path: <showel...@yahoo.com>
X-Original-To: python-l...@python.org
Delivered-To: python-l...@bag.python.org
X-Spam-Status: OK 0.011
X-YMail-OSG: sbReehAVM1mbxWEi.bOremFKntBcKqJurSnC6qQx1N7YRcGcywf89Fe14el0d_qy88ZxFzFUG4JHVrNvR49PvqQ6ctQtYAETNy7WTNtPDTXVGmIZTNONizcQeZHtfw--
Date: Sat, 26 May 2007 23:30:37 -0700 (PDT)
From: Steve Howell <showel...@yahoo.com>
Subject: Re: ten small Python programs
To: Steven D'Aprano <st...@REMOVE.THIS.cybersource.com.au>,
python-l...@python.org
In-Reply-To: <pan.2007.05.27.06.09.58.561209@REMOVE.THIS.cybersource.com.au>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-BeenThere: python-l...@python.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <http://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-requ...@python.org?subject=unsubscribe>
List-Archive: <http://mail.python.org/pipermail/python-list>
List-Post: <mailto:python-l...@python.org>
List-Help: <mailto:python-list-requ...@python.org?subject=help>
List-Subscribe: <http://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-requ...@python.org?subject=subscribe>
Newsgroups: comp.lang.python
Message-ID: <mailman.8235.1180247443.32031.python-list@python.org>
Lines: 45
NNTP-Posting-Host: 194.109.207.14
X-Trace: 1180247443 news.xs4all.nl 333 [::ffff:194.109.207.14]:46337
X-Complaints-To: abuse@xs4all.nl
--- Steven D'Aprano
<st...@REMOVE.THIS.cybersource.com.au> wrote:
> On Sat, 26 May 2007 18:48:45 -0700, Steve Howell
> wrote:
>
> > It also has a ComplexNumber class, but I don't
> want to
> > scare away mathphobes.
>
> Is it as short as this one-liner?
>
> ComplexNumber = complex
>
The "It" above refers to *the* Python Tutorial,
written by Guido van Rossum. Here is an excerpt:
>>> class Complex:
... def __init__(self, realpart, imagpart):
... self.r = realpart
... self.i = imagpart
...
>>> x = Complex(3.0, -4.5)
>>> x.r, x.i
(3.0, -4.5)
Obviously, it's not surprising that a useful class in
a tutorial would have a corresponding implementation
in the standard library, but I'm not sure newbies
would learn much about classes from this statement:
ComplexNumber = complex
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091