On Sun, Oct 7, 2012 at 1:33 AM, Franck Ditter wrote:
>
As a matter of netiquette, please don't post from a
plausible-but-invalid email address, especially at a domain that
doesn't seem to belong to you. (I got a mailer-daemon bounce when
replying to your posts.)
If you must use an invalid address
On Sun, 07 Oct 2012 10:33:36 +0200, Franck Ditter wrote:
> Question : I may consider + as an hidden instance method , as 1+2 is
> equivalent to (1).__add__(2) ? I also consider __abs__ as an instance
> method :
(-2).__abs__()
> 2
The short answer is, yes.
The *correct* answer is, not quite
On Sun, Oct 7, 2012 at 1:33 AM, Franck Ditter wrote:
> Hi ! Here is Python 3.2.3, MacOSX-Lion
>
> Question 0 : I may consider + as an hidden instance method , as
> 1+2 is equivalent to (1).__add__(2) ?
No, it's not nearly that simple. It's technically equivalent to
operator.add(1, 2) [
http://doc
Hi ! Here is Python 3.2.3, MacOSX-Lion
Question : I may consider + as an hidden instance method , as
1+2 is equivalent to (1).__add__(2) ?
I also consider __abs__ as an instance method :
>>> (-2).__abs__()
2
Question 1 : could the parser cope with the mandatory space
in 1 .__add__(2) ?
Question