ST

Size: a a a
ST
S
АП
HTTPSConnectionPool(host='my-domain.io', port=443): Max retries exceeded with url: /centrifugo/api (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f088e765130>, 'Connection to my-domain.io timed out. (connect timeout=1)'))
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='my-domain.io', port=443): Max retries exceeded with url: /centrifugo/api (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f088e765970>: Failed to establish a new connection: [Errno 110] Connection timed out'))
t
HTTPSConnectionPool(host='my-domain.io', port=443): Max retries exceeded with url: /centrifugo/api (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f088e765130>, 'Connection to my-domain.io timed out. (connect timeout=1)'))
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='my-domain.io', port=443): Max retries exceeded with url: /centrifugo/api (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f088e765970>: Failed to establish a new connection: [Errno 110] Connection timed out'))
t
t
t
t
t
t
HTTPSConnectionPool(host='my-domain.io', port=443): Max retries exceeded with url: /centrifugo/api (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f088e765130>, 'Connection to my-domain.io timed out. (connect timeout=1)'))
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='my-domain.io', port=443): Max retries exceeded with url: /centrifugo/api (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f088e765970>: Failed to establish a new connection: [Errno 110] Connection timed out'))
S
AO
S
S
SO
AT
AT
yield
can be used in generator expressions and comprehensions:[(yield i) for i in 'ab']
# <generator object <listcomp> at 0x7f2ba1431f48>
list([(yield i) for i in 'ab'])
# ['a', 'b']
list((yield i) for i in 'ab')
# ['a', None, 'b', None]
yield
can be used in any function (turning it into a generator) and comprehensions are compiled into functions:>>> dis.dis("[(yield i) for i in range(3)]")
0 LOAD_CONST 0 (<code object <listcomp> ...>)
2 LOAD_CONST 1 ('<listcomp>')
4 MAKE_FUNCTION 0
...
SyntaxError
in python 3.8+. However, yield
inside lambda
still can be used:a = lambda x: (yield x)
list(a(1))
# [1]
N
SF
yield
can be used in generator expressions and comprehensions:[(yield i) for i in 'ab']
# <generator object <listcomp> at 0x7f2ba1431f48>
list([(yield i) for i in 'ab'])
# ['a', 'b']
list((yield i) for i in 'ab')
# ['a', None, 'b', None]
yield
can be used in any function (turning it into a generator) and comprehensions are compiled into functions:>>> dis.dis("[(yield i) for i in range(3)]")
0 LOAD_CONST 0 (<code object <listcomp> ...>)
2 LOAD_CONST 1 ('<listcomp>')
4 MAKE_FUNCTION 0
...
SyntaxError
in python 3.8+. However, yield
inside lambda
still can be used:a = lambda x: (yield x)
list(a(1))
# [1]