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/2017-April/147755.html below:

[Python-Dev] Sorting

[Python-Dev] Sorting [Python-Dev] SortingSteven D'Aprano steve at pearwood.info
Wed Apr 5 22:24:47 EDT 2017
On Thu, Apr 06, 2017 at 02:30:06AM +0200, Oleg Broytman wrote:

>    Sorry, let me pour a bit of cold water here. Recently I was busy
> porting a few big and small (but complex) programs to Python 3 and was
> sending thousands curses every day. str=>unicode is the biggest change
> but not the most painful. The worst was when I spent few days hunting
> for a subtle bug caused by absent of unbound methods.
>    Painful. :-(

I'm curious about this. What do you mean? Python 3 has unbound methods, 
they're just the original, unwrapped function:

py> class K:
...     def method(self, arg):
...             pass
...
py> K.method
<function K.method at 0xb7cbd6a4>


The only(?) functional difference between unbound methods in Python 2 
versus 3 is that in Python 2 they automatically do a type-check that 
`self` is an instance of the class.



-- 
Steve
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