A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2015-October/141956.html below:

[Python-Dev] compatibility for C-accelerated types

[Python-Dev] compatibility for C-accelerated types [Python-Dev] compatibility for C-accelerated typesSerhiy Storchaka storchaka at gmail.com
Sat Oct 17 18:38:21 EDT 2015
On 18.10.15 01:20, Eric Snow wrote:
> On the tracker he notes another OrderedDict compatibility break:
>
>      Backward compatibility related to __class__ assignment was
>      already broken in C implementation. In 3.4 following code
>      works:
>
>      >>> from collections import *
>      >>> class foo(OrderedDict):
>      ...     def bark(self): return "spam"
>      ...
>      >>> class bar(OrderedDict):
>      ...     pass
>      ...
>      >>> od = bar()
>      >>> od.__class__ = foo
>      >>> od.bark()
>      'spam'
>
>      In 3.5 it doesn't.

Sorry, I was mistaken with this example. It works in 3.5.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4