Mailing List Archive

need .append patch (was RE: Re: Python-checkins digest, Vol 1 #370 - 8 msgs)
Somebody feel like whipping up a patch to fix the rest of the .append errors
in the CVS tree? I'm out of time!

.\Tools\scripts\mailerdaemon.py(221):
list.append(errordict[e], errorfirst[e], errorlast[e], e)

.\Demo\tkinter\www\fmt.py(224):
self.para.words.append(self.nextfont, text, \

.\Demo\tkinter\www\fmt.py(343):
para.words.append('r', '', 0, 0, 0, 0) # temporary, deleted at end

.\Demo\tkinter\www\sgmllib.py(199):
attrs.append(string.lower(attrname), attrvalue)

.\Demo\sgi\video\VcrIndex.py(84):
sorted.append(self.movies[name]['-ALL-']['START'],
name)

.\Demo\sgi\video\VcrIndex.py(100):
sorted.append(scenedict[name], name)

.\Demo\sgi\video\VcrIndex.py(116):
sorted.append(scenedict[name]['START'], name)

.\Demo\sgi\gl\glstdwin\glstdwin.py(314):
G.queue.append(WE_DEACTIVATE, G.focus, None)

.\Demo\sgi\gl\glstdwin\glstdwin.py(317):
G.queue.append(WE_ACTIVATE, G.focus, None)

.\Demo\ibrowse\ibrowse.py(492):
win.last.append(lastnode, win.textobj.getfocus())
Re: need .append patch (was RE: Re: Python-checkins digest, Vol 1 #370 - 8 msgs) [ In reply to ]
> Somebody feel like whipping up a patch to fix the rest of the .append errors
> in the CVS tree? I'm out of time!
>
> .\Tools\scripts\mailerdaemon.py(221):
> list.append(errordict[e], errorfirst[e], errorlast[e], e)

Done.

> .\Demo\tkinter\www\fmt.py(224):
> self.para.words.append(self.nextfont, text, \
>
> .\Demo\tkinter\www\fmt.py(343):
> para.words.append('r', '', 0, 0, 0, 0) # temporary, deleted at end
>
> .\Demo\tkinter\www\sgmllib.py(199):
> attrs.append(string.lower(attrname), attrvalue)

This whole directory should be nixed -- it's 5 years old and contains
mostly misinformation, like ancient versions of standard library
modules...

> .\Demo\sgi\video\VcrIndex.py(84):
> sorted.append(self.movies[name]['-ALL-']['START'],
> name)
>
> .\Demo\sgi\video\VcrIndex.py(100):
> sorted.append(scenedict[name], name)
>
> .\Demo\sgi\video\VcrIndex.py(116):
> sorted.append(scenedict[name]['START'], name)

This hardware probably doesn't even exist any more... I'm for nixing
it too.

> .\Demo\sgi\gl\glstdwin\glstdwin.py(314):
> G.queue.append(WE_DEACTIVATE, G.focus, None)
>
> .\Demo\sgi\gl\glstdwin\glstdwin.py(317):
> G.queue.append(WE_ACTIVATE, G.focus, None)
>
> .\Demo\ibrowse\ibrowse.py(492):
> win.last.append(lastnode, win.textobj.getfocus())

All these are stdwin-related. Stdwin will also go out of service per
1.6.

(Conclusion: most multi-arg append() calls are *very* old, or
contributed by others. Sigh. I must've given bad examples long
ago...)

--Guido van Rossum (home page: http://www.python.org/~guido/)
RE: need .append patch (was RE: Re: Python-checkins digest, Vol 1 #370 - 8 msgs) [ In reply to ]
[.Tim, runs checkappend.py over the entire CVS tree, comes up with
surprisingly many remaining problems, and surprisingly few false hits]

[.Guido fixes mailerdaemon.py, and argues for nuking

Demo\tkinter\www\ (the whole directory)
Demo\sgi\video\VcrIndex.py (unclear whether the dir or just the file)

Demo\sgi\gl\glstdwin\glstdwin.py (stdwin-related)
Demo\ibrowse\ibrowse.py (stdwin-related)
> All these are stdwin-related. Stdwin will also go out of service per
> 1.6.
]

Then the sooner someone nukes them from the CVS tree, the sooner my
automated hourly checkappend complaint generator will stop pestering
Python-Dev about them <wink>.

> (Conclusion: most multi-arg append() calls are *very* old,

But part of that is because we went thru this exercise a couple years ago
too, and you repaired all the ones in the less obscure parts of the
distribution then.

> or contributed by others. Sigh. I must've given bad examples long
> ago...)

Na, I doubt that. Most people will not read a language defn, at least not
until "something doesn't work". If the compiler accepts a thing, they
simply *assume* it's correct. It's pretty easy (at least for me!) to make
this particular mistake as a careless typo, so I assume that's the "source
origin" for many of these too. As soon you *notice* you've done it, and
that nothing bad happened, the natural tendencies are to (a) believe it's
OK, and (b) save 4 keystrokes (incl. the SHIFTs) over & over again in the
glorious indefinite future <wink>.

Reminds me of a c.l.py thread a while back, wherein someone did stuff like

None, x, y, None = function_returning_a_4_tuple

to mean that they didn't care what the 1st & 4th values were. It happened
to work, so they did it more & more. Eventually a function containing this
mistake needed to reference None after that line, and "suddenly for no
reason at all Python stopped working".

To the extent that you're serious about CP4E, you're begging for more of
this, not less <wink>.

newbies-even-keep-on-doing-things-that-*don't*-work!-ly y'rs - tim
Re: need .append patch (was RE: Re: Python-checkins digest, Vol 1 #370 - 8 msgs) [ In reply to ]
> To the extent that you're serious about CP4E, you're begging for more of
> this, not less <wink>.

Which is exactly why I am breaking multi-arg append now -- this is my
last chance.

--Guido van Rossum (home page: http://www.python.org/~guido/)