[Python-ideas] Fwd: Define a method or function attribute outside of a class with the dot operator

Steven D'Aprano steve at pearwood.info
Fri Feb 10 08:42:57 EST 2017


On Fri, Feb 10, 2017 at 02:28:25PM +0200, Markus Meskanen wrote:

> I've started working on a PEP for this since most people seem to be for it.

I don't know how you get "most people" -- there's only been a handful of 
responses in the few hours since the original post. And apart from one 
explicit -1, I read most of them as neutral, not in favour.

Of course you are perfectly entitled to start work on a PEP at any time, 
but don't get your hopes up.

I'm one of the neutral parties, perhaps just a tiny bit positive +0, but 
only for the original proposal.

I am -1000 on allowing arbitrary assignment targets. I believe that the 
cost in readability far outweighs the usefulness of allowing things 
like:

def mydict[key].attr[-1](arg): ...


-- 
Steve


More information about the Python-ideas mailing list