Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21128

Re: exec

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'none:': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.13; 'op.': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:t-dialin.net': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'interface': 0.23; 'from:addr:web.de': 0.23; 'class': 0.29; 'suggested': 0.32; 'instead': 0.33; 'header:X-Complaints-To:1': 0.34; 'to:addr:python-list': 0.35; '...': 0.35; 'received:org': 0.36; 'skip:_ 10': 0.38; 'to:addr:python.org': 0.40; 'design': 0.61; 'self.value': 0.84; 'value):': 0.84; 'alone.': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Peter Otten <__peter__@web.de>
Subject Re: exec
Date Fri, 02 Mar 2012 08:26:13 +0100
Organization None
References <4f4f7527$1@news.fhg.de> <4f4f9d55$1@news.fhg.de> <jioaqe$kl0$1@dough.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Gmane-NNTP-Posting-Host p5084a334.dip.t-dialin.net
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.343.1330673184.3037.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1330673184 news.xs4all.nl 6951 [2001:888:2000:d::a6]:34170
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:21128

Show key headers only | View raw


Prasad, Ramit wrote:

> Hi Peter,
> 
> >>> class Magnitude(object):
> 
> ...     def __init__(self, value):
> ...             self.value = value
> ...     def __call__(self, uf=1):
> ...             if uf == 1:
> ...                     return self
> ...             return self.value
> ...
> 
> >>> class Iron(object):
> 
> ...     def __init__(self):
> ...             self.rho = Magnitude(42)
> ...
> 
> 
> Why did you make uf=1 instead of None?
> 
> ...     def __call__(self, uf=None):
> ...             if uf is None:

That's a design decision of the OP. I suggested an improvement of the 
implementation and left the interface alone.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

exec Rolf Wester <rolf.wester@ilt.fraunhofer.de> - 2012-03-01 14:07 +0100
  Re: exec Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-03-01 14:46 +0100
  Re: exec Arnaud Delobelle <arnodel@gmail.com> - 2012-03-01 14:13 +0000
  Re: exec Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-03-01 14:21 +0000
  Re: exec Rolf Wester <rolf.wester@ilt.fraunhofer.de> - 2012-03-01 16:58 +0100
    Re: exec Michael Ströder <michael@stroeder.com> - 2012-03-01 17:26 +0100
    Re: exec Peter Otten <__peter__@web.de> - 2012-03-01 18:14 +0100
      Re: exec Rolf Wester <rolf.wester@ilt.fraunhofer.de> - 2012-03-01 18:23 +0100
    Re: exec Peter Otten <__peter__@web.de> - 2012-03-02 08:26 +0100

csiph-web