Nick Coghlan wrote:
> I actually hope that extended function call syntax in Py3k will
> use iterators rather than tuples so that this problem goes away.

I suggested this a while back on the Python list:
    http://mail.python.org/pipermail/python-list/2004-December/257282.html

Raymond Hettinger brought up a few pretty valid complaints, the
biggest of which is that a lot of code now expects *args to be
sequences, not iterators.  For example, the code you posted on the
Wiki[1] would break:

    def write(*args, **kwds):
        ...
        # may break if args iterator does not have a __len__
        if not args:
            return
        ...
        # will break unless "args = tuple(args)" precedes it
        stream.write(str(args[0]))
        for arg in args[1:]:
            stream.write(sep)
            stream.write(str(arg))

This code would have to be rewritten to use the iterator's .next()
method and try/excepts for StopIterations.  It's not particularly
hard, but people would have to do some relearning about *args.

[1] http://wiki.python.org/moin/PrintAsFunction

STeVe
-- 
You can wordify anything if you just verb it.
        --- Bucky Katt, Get Fuzzy
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to