[pypy-dev] oopspec

Antonio Cuni anto.cuni at gmail.com
Wed May 3 01:00:28 CEST 2006


Hi Armin

Armin Rigo wrote:
> It's quite open; every piece of code using oopspec should be prepared to
> see names that it doesn't know about, and ignore them.  So feel free to
> add new names.  As a guideline, let's stick as far as possible to the
> Python name for the method or for the __xxx__ special method name (with
> __ removed): 'remove_range' looks like it could be called 'delslice' in
> oopspec.

I'm unsure about using 'delslice': it make me think that such an 
operation behave exactly like the corresponding python statement, but 
that was not my intent: in my mind the difference between 'remove_range' 
and 'delslice' is that the first doesn't handle negative indexes and so 
it is likely that the target has some built-in method that implement it 
natively.

Btw I have not thought to it too much, so I don't know if such a 
refactoring is worth the pain: maybe it is simply more effective to 
write a delslice method in C# (or whatever language fit other backends) 
and forwarding the hypothetic 'delslice' to it, even it would mean that 
each backend has to write its own implementation if they don't get 
satisfaction with the default one.

ciao Anto



More information about the Pypy-dev mailing list