Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tkinter: C API changes are needed for Tcl 8.7 and 9.0 value types #103194

Closed
@chrstphrchvz

Description

@chrstphrchvz

Bug report

I recently made changes toTcl.pm (a Tcl wrapper for Perl) to support Tcl 8.7/9.0 (gisle/tcl.pm#42). While I was doing so, I briefly looked at _tkinter.c for comparison (particularlyAsObj() andFromObj()). Although I have not attempted to run Tkinter with Tcl 8.7/9.0, I do notice a few issues in the code which would need to be addressed first.

  • Tcl 9.0 currently renames the Tcl 8.5 "booleanString" value type to "boolean", which will break the existing check inFromObj(). Tcl has suggested an idiom for retrieving theTcl_ObjType * of unregistered types like "booleanString", regardless of Tcl version (seehttps://core.tcl-lang.org/tcl/info/3bb3bcf2da5b); although I would think that approach entails initializingv->BooleanType fromTkapp_New() rather than lazily initializingtkapp->BooleanType fromFromObj().

  • TIP 568: As of Tcl 9.0, "bytearray" is unregistered; the suggested idiom can be used instead.

  • TIP 484: As of Tcl 8.7, on platforms with 32-bitlong, there are no longer separate 32-bit "int" and 64-bit "wideInt" value types; there is only a single 64-bit type. And as of Tcl 9.0, the "int" type is unregistered. It is possible to reliably get theTcl_ObjType * of "int" from a value created usingTcl_NewIntObj(0) and of "wideInt" (if present) using e.g.Tcl_NewWideIntObj((Tcl_WideInt)(1) << 32). However it would not be appropriate forFromObj() to continue usingTcl_GetLongFromObj() whenlong is 32-bit, as that would retrieve an overflowed result for values within (LONG_MAX,ULONG_MAX] rather than forceFromObj() to try again withTcl_GetWideIntFromObj() (viafromWideIntObj()); an alternative would be to always useTcl_GetWideIntFromObj() for both "int" and "wideInt" values.

I am not familiar with contributing to Python, but I may be able to propose fixes for the above issues if no one else already has or intends to. I believe the fixes for the above issues are backward compatible with Tcl 8.5 and 8.6, and so can be implemented and tested without other changes that are likely also needed (such as for Tcl-syntax APIs) before Tkinter is usable withTcl 8.7/9.0 and Tk 8.7 (which will be compatible with both Tcl 8.7 and 9.0) Tcl and Tk 8.7/9.0.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp