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
d1ced9e8
Kaydet (Commit)
d1ced9e8
authored
Ara 29, 2012
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #16642: Document kwargs field in sched.Event named tuple.
üst
49f7e587
e912496c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
sched.rst
Doc/library/sched.rst
+2
-1
sched.py
Lib/sched.py
+3
-3
No files found.
Doc/library/sched.rst
Dosyayı görüntüle @
d1ced9e8
...
@@ -27,6 +27,7 @@ scheduler:
...
@@ -27,6 +27,7 @@ scheduler:
.. versionchanged:: 3.3
.. versionchanged:: 3.3
*timefunc* and *delayfunc* parameters are optional.
*timefunc* and *delayfunc* parameters are optional.
.. versionchanged:: 3.3
.. versionchanged:: 3.3
:class:`scheduler` class can be safely used in multi-threaded
:class:`scheduler` class can be safely used in multi-threaded
environments.
environments.
...
@@ -129,4 +130,4 @@ Scheduler Objects
...
@@ -129,4 +130,4 @@ Scheduler Objects
Read-only attribute returning a list of upcoming events in the order they
Read-only attribute returning a list of upcoming events in the order they
will be run. Each event is shown as a :term:`named tuple` with the
will be run. Each event is shown as a :term:`named tuple` with the
following fields: time, priority, action, argument.
following fields: time, priority, action, argument
, kwargs
.
Lib/sched.py
Dosyayı görüntüle @
d1ced9e8
...
@@ -13,12 +13,12 @@ also be used to integrate scheduling with STDWIN events; the delay
...
@@ -13,12 +13,12 @@ also be used to integrate scheduling with STDWIN events; the delay
function is allowed to modify the queue. Time can be expressed as
function is allowed to modify the queue. Time can be expressed as
integers or floating point numbers, as long as it is consistent.
integers or floating point numbers, as long as it is consistent.
Events are specified by tuples (time, priority, action, argument).
Events are specified by tuples (time, priority, action, argument
, kwargs
).
As in UNIX, lower priority numbers mean higher priority; in this
As in UNIX, lower priority numbers mean higher priority; in this
way the queue can be maintained as a priority queue. Execution of the
way the queue can be maintained as a priority queue. Execution of the
event means calling the action function, passing it the argument
event means calling the action function, passing it the argument
sequence in "argument" (remember that in Python, multiple function
sequence in "argument" (remember that in Python, multiple function
arguments are be packed in a sequence).
arguments are be packed in a sequence)
and keyword parameters in "kwargs"
.
The action function may be an instance method so it
The action function may be an instance method so it
has another way to reference private data (besides global variables).
has another way to reference private data (besides global variables).
"""
"""
...
@@ -151,7 +151,7 @@ class scheduler:
...
@@ -151,7 +151,7 @@ class scheduler:
"""An ordered list of upcoming events.
"""An ordered list of upcoming events.
Events are named tuples with fields for:
Events are named tuples with fields for:
time, priority, action, arguments
time, priority, action, arguments
, kwargs
"""
"""
# Use heapq to sort the queue rather than using 'sorted(self._queue)'.
# Use heapq to sort the queue rather than using 'sorted(self._queue)'.
...
...
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