[Python-ideas] RFC: PEP: Add dict.__version__

Neil Girdhar mistersheik at gmail.com
Sat Jan 9 12:01:51 EST 2016


On Sat, Jan 9, 2016 at 11:27 AM, Victor Stinner <victor.stinner at gmail.com>
wrote:

>
>
> Le samedi 9 janvier 2016, Neil Girdhar <mistersheik at gmail.com> a écrit :
>>
>> On Sat, Jan 9, 2016 at 8:42 AM, Victor Stinner <victor.stinner at gmail.com>
>> wrote:
>>>
>>> I wrote a whole website to explain the status of the Python optimizers
>>> and why I want to write my own optimizer:
>>> https://faster-cpython.readthedocs.org/index.html
>>
>>
>> I think this is admirable.  I also dream of faster Python.  However, we
>> have a fundamental disagreement about how to get there.  You can spend your
>> whole life adding one or two optimizations a year and Python may only end
>> up twice as fast as it is now, which would still be dog slow. A meaningful
>> speedup requires a JIT.  So, I question the value of this kind of change.
>>
>
> There are multiple JIT compilers for Python actively developped: PyPy,
> Pyston, Pyjion, Numba (numerical computation), etc.
>
> I don't think that my work will slow down these projects. I hope that it
> will create more competition and that we will cooperate. For example, I am
> in contact with a Pythran developer who told me that my PEPs will help his
> project. As I wrote in the dict.__version__ PEP, the dictionary version
> will also be useful for Pyjion according to Brett Canon.
>
> But Antoine Pitrou told me that dictionary version will not help Numba.
> Numba doesn't use dictionaries and already has its own
> efficient implemenation for guards.
>
>
>> What is the point of making __version__ an exposed property?
>>
>
> Hum, technically I don't need it at the Python level. Guards are
> implemented in C and access directly the field from the strcuture.
>
> Having the property in Python helps to write unit tests, to write
> prototypes (experiment new things), etc.
>

I understand what you mean, but If you can do this without changing the
language, I think that would be better.  Isn't it still possible to write
your unit tests in the same C interface that you expose "version" with?
Then the language with stay the same, but CPython would be faster, which is
what you wanted.


>
>
>> That's fine, but I think you are probably wasting your time then :)  The
>> "hole between CPython and PyPy" disappears as soon as PyPy catches up to
>> CPython 3.5 with numpy, and then all of this work goes with it.
>>
>
> PyPy works since many years but it's still not widely used by users. Maybe
> PyPy has drawbacks and the speedup is not enough to convince users to use
> it? I'm not sure that Python 3.5 support wil make PyPy immediatly more
> popular. Users still widely use Python 2 in practice.
>
> Yes, better and faster numpy will help PyPy.
>
> Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160109/53683476/attachment.html>


More information about the Python-ideas mailing list