[Python-Dev] Checking in a broken test was: Re: [Python-checkins] r41940 - python/trunk/Lib/test/test_compiler.py

Guido van Rossum guido at python.org
Sun Jan 8 01:43:49 CET 2006


On 1/7/06, Neal Norwitz <nnorwitz at gmail.com> wrote:
> I'm proposing something like add two files to Lib/test:
> outstanding_bugs.py and outstanding_crashes.py.  Both would be normal
> test files with info about the bug report and the code that causes
> problems.

I like this approach. regrtest.py won't runthem, but you can run them
manually to help in finding the bug (if the cause isn't known yet) or
verifying it's been fixed (if it is).

> And for a different discussion:
>
> On 1/7/06, Jim Jewett <jimjjewett at gmail.com> wrote:
> > Maybe.  Guido's statement (maybe short of a pronouncement)
> > was that keyword-only arguments were OK in principle, and
> > that *args could follow keywords.  It wasn't true yet because
> > no one had put in the work, but it would be an acceptable
> > change.
> >
> > I interpret this to mean that
> >
> >     def f(a=1, b): pass
> >
> > should not necessarily raise an error, but I would like to see what
> > it does to
> >
> >     def f(a=1, b):
> >         print a,b
> >     f(b=7)
> >
> > before saying that it is OK.

I suspect you've got that wrong. I don't recall saying that you should
be able to put positional arguments after keyword arguments in a call
-- the meaning would be ambiguous to humans even if it can be given a
clear meaning by the compiler. Similarly, in a def it would also be
unclear to the human reader, and I'm not sure what the point would be.
(In the above example, the real question is what f(7) would mean --
does it set b to 7 or a?)

However, I *do* recall saying something about the relative ordering of
*args and **kwds. In particular, I think we should be allowed to write

 f(1, 2, 3, *args, x=1, y=2, **kwds)   # also without **kwds

and perhaps also

  f(1, 2, 3, *args, 4, 5, 6)

(though I'm less interested in supporting the latter).

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


More information about the Python-Dev mailing list