[Python-Dev] Augmented assignment

Thomas Wouters thomas@xs4all.net
Thu, 15 Jun 2000 19:53:27 +0200


I'd like some (minor) feedback on the augmented assignment thing I'm working
on. I understand Guido is the only one who accepts patches like this, and
appreciate that, but I'm hoping someone can at least tell me what I'm doing
wrong so I can fix it before Guido sees it ;-) But if I'm being an impatient
flap, just tell me so and I'll calm down.

I also appreciate the fact that the patch is quite large, and not many
people have the time to scrutinize each version, so I'll summerize the
issues I'm uncertain about.

 * The patch needs to add a new type of opcode, one that takes 2 arguments.
This is because the opcodes that load, change and store a name need one
argument for the index in the name table (or local variable number), and one
argument for the actual operation.

It could also work by using PyInt or another PyObject to pass the extra
argument on the stack, but I don't think pushing a non-PyObject-pointer onto
the stack is a good idea. Adding 2-argument opcodes seemed the easiest
solution.

However, I'm not really into Python-hacking (or was, I should say, because
it's great fun) and the python-dev list doesn't seem to be searchable ;) so
I can't know if this issue has come up before. Has it ? Would the new
opcode-type be an unsurpassable problem ? should I use the stack instead ?

* The patch also needs to add 11 new __hooks__, 11 new API calls, 11 new entries
in the PyNumberMethods struct and 2 new entries in the PySequenceMethods
struct. Would that conceivably be a problem ? I've heard people on the
python-list complain about this ;-P

 * Should I start sending the patch, in pieces, to the patches-list, or is
it a wasted effort because noone will touch it until Guido is back ? If I
should send it, should I send it in one large patch (minus autogenerated
files) or in nice functionality-sized pieces ?

 * How 'cool' does Guido actually think this syntax is ? Apparently the
subject has come up a few times ;) and I got positive signals from both Tim
and Guido, but if the patch won't go in as a patch, and won't actually be
used other than some inspiration for a future rewrite of the CPython core,
I'm not going to worry too much about the patch ;)

I'm trying to get my boss to send me to OSCON2000 to harass Guido about
these issues himself, but he (my boss) isn't co-operating ;-P (Not
suprising, as Python isn't quite part of my job description, *snif*)

Regards,

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!