@@ -282,6 +282,9 @@ always available.
282282
283283 Return the interpreter's "check interval"; see :func: `setcheckinterval `.
284284
285+ .. deprecated :: 3.2
286+ Use :func: `getswitchinterval ` instead.
287+
285288
286289.. function :: getdefaultencoding()
287290
@@ -345,6 +348,12 @@ always available.
345348 collector.
346349
347350
351+ .. function :: getswitchinterval()
352+
353+ Return the interpreter's "thread switch interval"; see
354+ :func: `setswitchinterval `.
355+
356+
348357.. function :: _getframe([depth])
349358
350359 Return a frame object from the call stack. If optional integer *depth * is
@@ -626,6 +635,11 @@ always available.
626635 performance for programs using threads. Setting it to a value ``<= `` 0 checks
627636 every virtual instruction, maximizing responsiveness as well as overhead.
628637
638+ .. deprecated :: 3.2
639+ This function doesn't have an effect anymore, as the internal logic
640+ for thread switching and asynchronous tasks has been rewritten.
641+ Use :func: `setswitchinterval ` instead.
642+
629643
630644.. function :: setdefaultencoding(name)
631645
@@ -689,6 +703,17 @@ always available.
689703 limit can lead to a crash.
690704
691705
706+ .. function :: setswitchinterval(interval)
707+
708+ Set the interpreter's thread switch interval (in seconds). This floating-point
709+ value determines the ideal duration of the "timeslices" allocated to
710+ concurrently running Python threads. Please note that the actual value
711+ can be higher, especially if long-running internal functions or methods
712+ are used. Also, which thread becomes scheduled at the end of the interval
713+ is the operating system's decision. The interpreter doesn't have its
714+ own scheduler.
715+
716+
692717.. function :: settrace(tracefunc)
693718
694719 .. index ::
0 commit comments