Hi.
Example test.py:
class A():
def __add__(self, var):
print(I'm in A class)
return 5
a = A()
a+1
1+a
Execution:
python test.py
I'm in A class
Traceback (most recent call last):
File ../../test.py, line 7, in module
1+a
TypeError: unsupported operand type(s) for +:
Hi.
Example test.py:
class A():
def __add__(self, var):
print(I'm in A class)
return 5
a = A()
a+1
1+a
Execution:
python test.py
I'm in A class
Traceback (most recent call last):
File ../../test.py, line 7, in module
1+a
TypeError: unsupported operand type(s) for +:
On Thu, Oct 3, 2013 at 11:09 PM, Игорь Васильев vasilyev_i...@inbox.ru wrote:
When we adding class to integer we have both slotv and slotw. x = slotv(v,
w); - returns Py_NotImplemented.
But in this case we should execute x = slotw(v, w); and function should be
completed in the same way as when
On 2013-10-03, at 15:45 , Igor Vasilyev wrote:
Hi.
Example test.py:
class A():
def __add__(self, var):
print(I'm in A class)
return 5
a = A()
a+1
1+a
Execution:
python test.py
I'm in A class
Traceback (most recent call last):
File ../../test.py, line 7, in
This list is for development OF Python, not for development in python. For
that reason, I will redirect this to python-list as well. My actual answer
is below.
On Thu, Oct 3, 2013 at 6:45 AM, Igor Vasilyev igor.vasil...@oracle.com
wrote:
Hi.
Example test.py:
class A():
def
Igor Vasilyev wrote:
class A():
def __add__(self, var):
print(I'm in A class)
return 5
a = A()
a+1
1+a
Execution:
python test.py
I'm in A class
Traceback (most recent call last):
File ../../test.py, line 7, in module
1+a
TypeError: unsupported operand type(s) for +: