[Python-ideas] Python-ideas Digest, Vol 49, Issue 10

M Daoust m_daoust at hotmail.com
Fri Dec 17 01:12:39 CET 2010


> Date: Tue, 14 Dec 2010 13:19:24 +0000
> From: Michael Foord <fuzzyman at voidspace.org.uk>
> To: "Gregory P. Smith" <greg at krypto.org>
> Cc: Python-Ideas <python-ideas at python.org>
> Subject: Re: [Python-ideas] replace boolean methods on builtin types
> 	with properties [py4k?]
> Message-ID:
> 	<AANLkTi=yEZ2i8j0CFF0V_P82S=WjULBFCq2gamO_xGu8 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> > On 13 December 2010 22:35, Gregory P. Smith <greg at krypto.org> wrote:
> >
> > A hack could be done today to have these behave as both functions and
> > properties by having the property return a callable bool derived class that
> > returns itself.  But that seems a bit too cool yet gross...
> >
> >
> bool derived class... good luck with that. :-)
> 
> Michael

Well it it doesn't sound that odd to me.
This it's one of the (few) things I miss from Matlab.
Not that parentheses are optional for function calls, but that 'true', 'false', 'Inf' and 'NaN' act both 
as their respective values,  and as functions. Like 'ones' and 'zeros' they can be called with a size 
tuple to get an array of nd-array of that value.

-Mark  
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20101216/005077c7/attachment.html>


More information about the Python-ideas mailing list