[issue46929] __rrshift__ for same class obj will raise TypeError

2022-03-05 Thread ZhengYu, Xu


New submission from ZhengYu, Xu :

```
class C:
def __rrshift__(self, v):
return 1

C() >> C()   # raise TypeError: unsupported operand types(s) for >>: 'C' and 'C'
```

--
messages: 414578
nosy: zen-xu
priority: normal
severity: normal
status: open
title: __rrshift__ for same class obj will  raise TypeError
type: behavior
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46929>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46929] __rrshift__ for same class obj will raise TypeError

2022-03-05 Thread ZhengYu, Xu


ZhengYu, Xu  added the comment:

But with different classed will be right

```
class C:
def __rrshift__(self, v):
return 1

class D:
def __rrshift__(self, v):
return 2

C() >> D() # 2
```

--

___
Python tracker 
<https://bugs.python.org/issue46929>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com