[Python-Dev] A Horrible Inconsistency

Steven Bethard steven.bethard at gmail.com
Fri May 26 18:25:28 CEST 2006


On 5/26/06, Facundo Batista <facundobatista at gmail.com> wrote:
> Aaaaall this different ways enforce my vote: we should get an error...

Perhaps you missed Tim's post, so here's a few lines of my own code
that I know would break:

    padding = [None] * (self.width - len(leaves))
    left_padding = [None] * (self.left_width - len(left_window))
    right_padding = [None] * (self.right_width - len(right_window))

Sure, I could write these as:

    padding = [None] * max(0, self.width - len(leaves))
    left_padding = [None] * max(0, self.left_width - len(left_window))
    right_padding = [None] * max(0, self.right_width - len(right_window))

But if this change goes in, I want a big "we're breaking backwards
incompatibility" message somewhere.  I say if you really want an
exception raised for these cases, ask for the behavior change in
Python 3000.  All it would give us in Python 2.X is a bunch of broken
code.

STeVe
-- 
Grammar am for people who can't think for myself.
        --- Bucky Katt, Get Fuzzy


More information about the Python-Dev mailing list