Re: [Python-ideas] PEP proposal: unifying function/method classes

2018-03-28 Thread Serhiy Storchaka
28.03.18 20:22, Erik Bray пише: On Fri, Mar 23, 2018 at 11:25 AM, Antoine Pitrou wrote: One breaking change would be to add __get__ to C functions. This means e.g. the following: class MyClass: my_open = open would make my_open a MyClass method, therefore you would need to spell it: cl

Re: [Python-ideas] PEP proposal: unifying function/method classes

2018-03-28 Thread Antoine Pitrou
On Wed, 28 Mar 2018 19:22:50 +0200 Erik Bray wrote: > > I don't really see your point in this example. For one: why would > anyone do this? Is this based on a real example? Yes, I remember doing that when writing unit tests for open() and open()-like functions. You would write a base test cas

Re: [Python-ideas] PEP proposal: unifying function/method classes

2018-03-28 Thread Erik Bray
On Fri, Mar 23, 2018 at 11:25 AM, Antoine Pitrou wrote: > On Fri, 23 Mar 2018 07:25:33 +0100 > Jeroen Demeyer wrote: > >> On 2018-03-23 00:36, Antoine Pitrou wrote: >> > It does make sense, since the proposal sounds ambitious (and perhaps >> > impossible without breaking compatibility). >> >> Wel