[Python-Dev] compatibility for C-accelerated types (original) (raw)
Maciej Fijalkowski fijall at gmail.com
Tue Oct 20 04:38:07 EDT 2015
- Previous message (by thread): [Python-Dev] compatibility for C-accelerated types
- Next message (by thread): [Python-Dev] compatibility for C-accelerated types
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
For what is worth, that level of differences already exists on pypy and it's really hard to get the exact same semantics if things are implemented in python vs C or the other way around.
Example list of differences (which I think OrderedDict already breaks if moved to C):
do methods like items call special methods like getitem (I think it's undecided anyway)
what happens if you take a method and rebind it to another subclass, does it automatically become a method (there are differences between built in and pure python)
atomicity of operations. Some operations used to be non-atomic in Python will be atomic now.
I personally think those (and the class issue) are unavoidable
On Mon, Oct 19, 2015 at 11:47 PM, Serhiy Storchaka <storchaka at gmail.com> wrote:
On 20.10.15 00:00, Guido van Rossum wrote:
Apart from Serhiy's detraction of the 3.5 bug report there wasn't any discussion in this thread. I also don't really see any specific questions, so maybe you don't have any. Are you just asking whether it's okay to merge your code? Or are you asking for more code review? I think Eric ask whether it's okay to have some incompatibility between Python and C implementations. 1. Is it okay to have a difference in effect of class assignment. Pure Python and extension classes have different restrictions. For example (tested example this time) following code works with Python implementation in 3.4, but fails with C implementation in 3.5: from collections import OrderedDict od = OrderedDict() class D(dict): pass od.class = D 2. Is it okay to use obj.class in Python implementation and type(obj) in C implementation for the sake of code simplification? Can we ignore subtle differences? 3. In general, is it okay to have some incompatibility between Python and C implementations for the sake of code simplification, and where the border line lies?
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/fijall%40gmail.com
- Previous message (by thread): [Python-Dev] compatibility for C-accelerated types
- Next message (by thread): [Python-Dev] compatibility for C-accelerated types
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]