For review: PEP 308 - If-then-else expression

holger krekel pyth at devel.trillke.net
Sat Feb 8 14:27:22 EST 2003


Dale Strickland-Clark wrote:
> Michael Hudson <mwh at python.net> wrote:
> 
> >Dale Strickland-Clark <dale at riverhall.NOTHANKS.co.uk> writes:
> >
> >> I am quite surprised at the number of people who have missed important
> >> points in this proposal and at the amount of prejudice against
> >> suggestions that have already appeared in other languages.
> >
> >I'm prejudiced against change, and proud of it.  Not to the extent of
> >opposing all change without consideration, but my default opinion of
> >any change is "no thanks" and the merits of any change have to
> >overcome that.
> 
> Then you are against language development. Why not just take your
> current download of Python and leave?

why?  Michael has cvs-commit rights <wink> so he doesn't need to 
work on his private tar-based copy. 

> One of the beauties of Python is the way it is growing and evolving.

Not the fact that it grows but *what* it grows is important.  If
all weird ideas got implemented (including some of my own) then
many people might leave python. 

> >And then there's the fact that I really don't think this change is an
> >enhancement.
> >
> 
> You have an odd understanding of enhancement, then.

In my book he has a quite well-founded understanding of enhancements
which other people still need to prove <wink>, including myself.

> >I went through quite a large bunch of my code code searching for 'if
> >'.  I've found *nothing* that I would consider improved by an
> >if-then-else expression.  Maybe this is just the fact that I'm so
> >inured to the lack of an if-then-else expression I have come to see a
> >limitation as a virtue -- but I don't think so.
> >
> >An example:
> >
> >    def get_arg(self, default=1):
> >        """Return any prefix argument that the user has supplied,
> >        returning `default' if there is None.  `default' defaults
> >        (groan) to 1."""
> >        if self.arg is None:
> >            return default
> >        else:
> >            return self.arg
> 
> Yuck! An pointless function that boils down to:
> 
> self.arg or default

wrong in more than one way.  

for starters, assume 'arg==0'.

> in current parlance. Or the same after the proposal. Not a good
> example. Are you paid by the code-line?

Aren't you going a bit far with this accusation?

    holger





More information about the Python-list mailing list