@@ -608,7 +608,7 @@ since it is impossible to detect the termination of alien threads.
608
608
timeout occurs.
609
609
610
610
When the *timeout * argument is present and not ``None ``, it should be a
611
- floating-point number specifying a timeout for the operation in seconds
611
+ real number specifying a timeout for the operation in seconds
612
612
(or fractions thereof). As :meth: `~Thread.join ` always returns ``None ``,
613
613
you must call :meth: `~Thread.is_alive ` after :meth: `~Thread.join ` to
614
614
decide whether a timeout happened -- if the thread is still alive, the
@@ -632,6 +632,9 @@ since it is impossible to detect the termination of alien threads.
632
632
633
633
May raise :exc: `PythonFinalizationError `.
634
634
635
+ .. versionchanged :: next
636
+ Accepts any real number as *timeout *, not only integer or float.
637
+
635
638
.. attribute :: name
636
639
637
640
A string used for identification purposes only. It has no semantics.
@@ -764,7 +767,7 @@ All methods are executed atomically.
764
767
If a call with *blocking * set to ``True `` would block, return ``False ``
765
768
immediately; otherwise, set the lock to locked and return ``True ``.
766
769
767
- When invoked with the floating-point *timeout * argument set to a positive
770
+ When invoked with the *timeout * argument set to a positive
768
771
value, block for at most the number of seconds specified by *timeout *
769
772
and as long as the lock cannot be acquired. A *timeout * argument of ``-1 ``
770
773
specifies an unbounded wait. It is forbidden to specify a *timeout *
@@ -783,6 +786,9 @@ All methods are executed atomically.
783
786
.. versionchanged :: 3.14
784
787
Lock acquisition can now be interrupted by signals on Windows.
785
788
789
+ .. versionchanged :: next
790
+ Accepts any real number as *timeout *, not only integer or float.
791
+
786
792
787
793
.. method :: release()
788
794
@@ -863,7 +869,7 @@ call release as many times the lock has been acquired can lead to deadlock.
863
869
* If no thread owns the lock, acquire the lock and return immediately.
864
870
865
871
* If another thread owns the lock, block until we are able to acquire
866
- lock, or *timeout *, if set to a positive float value.
872
+ lock, or *timeout *, if set to a positive value.
867
873
868
874
* If the same thread owns the lock, acquire the lock again, and
869
875
return immediately. This is the difference between :class: `Lock ` and
@@ -890,6 +896,9 @@ call release as many times the lock has been acquired can lead to deadlock.
890
896
.. versionchanged :: 3.2
891
897
The *timeout * parameter is new.
892
898
899
+ .. versionchanged :: next
900
+ Accepts any real number as *timeout *, not only integer or float.
901
+
893
902
894
903
.. method :: release()
895
904
@@ -1023,7 +1032,7 @@ item to the buffer only needs to wake up one consumer thread.
1023
1032
occurs. Once awakened or timed out, it re-acquires the lock and returns.
1024
1033
1025
1034
When the *timeout * argument is present and not ``None ``, it should be a
1026
- floating-point number specifying a timeout for the operation in seconds
1035
+ real number specifying a timeout for the operation in seconds
1027
1036
(or fractions thereof).
1028
1037
1029
1038
When the underlying lock is an :class: `RLock `, it is not released using
@@ -1150,6 +1159,9 @@ Semaphores also support the :ref:`context management protocol <with-locks>`.
1150
1159
.. versionchanged :: 3.2
1151
1160
The *timeout * parameter is new.
1152
1161
1162
+ .. versionchanged :: next
1163
+ Accepts any real number as *timeout *, not only integer or float.
1164
+
1153
1165
.. method :: release(n=1)
1154
1166
1155
1167
Release a semaphore, incrementing the internal counter by *n *. When it
@@ -1250,7 +1262,7 @@ method. The :meth:`~Event.wait` method blocks until the flag is true.
1250
1262
the internal flag did not become true within the given wait time.
1251
1263
1252
1264
When the timeout argument is present and not ``None ``, it should be a
1253
- floating-point number specifying a timeout for the operation in seconds,
1265
+ real number specifying a timeout for the operation in seconds,
1254
1266
or fractions thereof.
1255
1267
1256
1268
.. versionchanged :: 3.1
0 commit comments