[Python-Dev] compatibility for C-accelerated types (original) (raw)
Guido van Rossum guido at python.org
Mon Oct 19 18:01:32 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 ]
On Mon, Oct 19, 2015 at 2: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
Yes.
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?
Yes.
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?
I don't want to rule in general -- the above two look pretty clear-cut to me in this case, but even for class vs. type() it's conceivable that it might be important in some other case (e.g. if it was for a proxy class :-).
I think it's fine to ask here the next time there is some doubt about how far a C implementation would need to go.
-- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20151019/41125951/attachment.html>
- 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 ]