gh-127802: Schedule removal of legacy tkinter variable trace methods … · python/cpython@deeae2a

GitHub

GitHub CopilotWrite better code with AI | MCP RegistryIntegrate external tools | ActionsAutomate any workflow | CodespacesInstant dev environments | IssuesPlan and track work | Code ReviewManage code changes | Code QualityEnforce quality at merge | Why GitHub | Marketplace | View all features | Enterprises | Small and medium teams | Startups | View all use cases | View all industries | View all solutions | AI | Software Development | DevOps | Security | View all topics | Customer stories | Events & webinars | Ebooks & reports | Business insights | Trust center | Partners | View all resources

@@ -505,12 +505,14 @@ def trace_variable(self, mode, callback):

505505 Return the name of the callback.

506506507507 This deprecated method wraps a deprecated Tcl method removed

508- in Tcl 9.0. Use trace_add() instead.

508+ in Tcl 9.0 and will be removed in Python 3.17. Use trace_add()

509+ instead.

509510 """

510511importwarnings

511512warnings.warn(

512-"trace_variable() is deprecated and not supported with Tcl 9; "

513-"use trace_add() instead.",

513+"trace_variable() is deprecated and will be removed in Python "

514+"3.17; use trace_add() instead. It is not supported with "

515+"Tcl 9.",

514516DeprecationWarning, stacklevel=2)

515517cbname=self._register(callback)

516518self._tk.call("trace", "variable", self._name, mode, cbname)

@@ -525,12 +527,14 @@ def trace_vdelete(self, mode, cbname):

525527 CBNAME is the name of the callback returned from trace_variable or trace.

526528527529 This deprecated method wraps a deprecated Tcl method removed

528- in Tcl 9.0. Use trace_remove() instead.

530+ in Tcl 9.0 and will be removed in Python 3.17. Use trace_remove()

531+ instead.

529532 """

530533importwarnings

531534warnings.warn(

532-"trace_vdelete() is deprecated and not supported with Tcl 9; "

533-"use trace_remove() instead.",

535+"trace_vdelete() is deprecated and will be removed in Python "

536+"3.17; use trace_remove() instead. It is not supported with "

537+"Tcl 9.",

534538DeprecationWarning, stacklevel=2)

535539self._tk.call("trace", "vdelete", self._name, mode, cbname)

536540cbname=self._tk.splitlist(cbname)[0]

@@ -548,12 +552,14 @@ def trace_vinfo(self):

548552"""Return all trace callback information.

549553550554 This deprecated method wraps a deprecated Tcl method removed

551- in Tcl 9.0. Use trace_info() instead.

555+ in Tcl 9.0 and will be removed in Python 3.17. Use trace_info()

556+ instead.

552557 """

553558importwarnings

554559warnings.warn(

555-"trace_vinfo() is deprecated and not supported with Tcl 9; "

556-"use trace_info() instead.",

560+"trace_vinfo() is deprecated and will be removed in Python "

561+"3.17; use trace_info() instead. It is not supported with "

562+"Tcl 9.",

557563DeprecationWarning, stacklevel=2)

558564return [self._tk.splitlist(x) forxinself._tk.splitlist(

559565self._tk.call("trace", "vinfo", self._name))]