SB
Size: a a a
SB
ТК
БГ
py3
import sys
class stdout():
def __lshift__(self, other):
sys.stdout.write(other)
stdout << "fuckyou"
Traceback (most recent call last):
File "source_file.py", line 7, in <module>
stdout << "fuckyou"
TypeError: unsupported operand type(s) for <<: 'type' and 'str'
БГ
ТА
ТА
ТА
БГ
py3
import sys
class stdout():
@classmethod
def __lshift__(self, other):
sys.stdout.write(other)
stdout << "fuckyou"
Traceback (most recent call last):
File "source_file.py", line 8, in <module>
stdout << "fuckyou"
TypeError: unsupported operand type(s) for <<: 'type' and 'str'
БГ
БГ
NK
БГ
try:
...
except exc1, exc2, exc3:
...
NK
try:
...
except exc1, exc2, exc3:
...
NK
NK
NK
S
S
БГ
py3
try:
1/0
except (ZeroDivisionError, TypeError, NameError) as E:
print("{}: {}".format(E.__class__.__name__, E))
if isinstance(E, ZeroDivisionError):
print("check your numbers, stupid motherfucker")
ZeroDivisionError: division by zero
check your numbers, stupid motherfucker