Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e549c4be
Kaydet (Commit)
e549c4be
authored
May 28, 2018
tarafından
jimmylai
Kaydeden (comit)
Yury Selivanov
May 28, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-33505: Optimize asyncio.ensure_future by reordering if conditions (GH-6836)
üst
23f587e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
tasks.py
Lib/asyncio/tasks.py
+5
-5
2018-05-14-18-05-35.bpo-33505.L8pAyt.rst
...S.d/next/Library/2018-05-14-18-05-35.bpo-33505.L8pAyt.rst
+1
-0
No files found.
Lib/asyncio/tasks.py
Dosyayı görüntüle @
e549c4be
...
...
@@ -542,17 +542,17 @@ def ensure_future(coro_or_future, *, loop=None):
If the argument is a Future, it is returned directly.
"""
if
futures
.
isfuture
(
coro_or_future
):
if
loop
is
not
None
and
loop
is
not
futures
.
_get_loop
(
coro_or_future
):
raise
ValueError
(
'loop argument must agree with Future'
)
return
coro_or_future
elif
coroutines
.
iscoroutine
(
coro_or_future
):
if
coroutines
.
iscoroutine
(
coro_or_future
):
if
loop
is
None
:
loop
=
events
.
get_event_loop
()
task
=
loop
.
create_task
(
coro_or_future
)
if
task
.
_source_traceback
:
del
task
.
_source_traceback
[
-
1
]
return
task
elif
futures
.
isfuture
(
coro_or_future
):
if
loop
is
not
None
and
loop
is
not
futures
.
_get_loop
(
coro_or_future
):
raise
ValueError
(
'loop argument must agree with Future'
)
return
coro_or_future
elif
inspect
.
isawaitable
(
coro_or_future
):
return
ensure_future
(
_wrap_awaitable
(
coro_or_future
),
loop
=
loop
)
else
:
...
...
Misc/NEWS.d/next/Library/2018-05-14-18-05-35.bpo-33505.L8pAyt.rst
0 → 100644
Dosyayı görüntüle @
e549c4be
Optimize asyncio.ensure_future() by reordering if checks: 1.17x faster.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment