What’s New In Tohil 4.1¶
tclobjs returned from more places¶
to=dict conversions now returns tclobjs for the dictionary values.
tclobj.as_dict() does so as well.
Python-side callback function registration¶
The new register_callback function provides a nice way to create Tcl commands that directly call corresponding Python functions. This is useful for processing asynchronous callbacks from the Tcl event loop using Python, and may be useful for other stuff as well.
Several other improvements¶
Pass None from Tcl to Python functions called via tohil::call by using the tohil::NONE sentinel.
More precise error messages when Tohil startup fails should help with troubleshooting installation problems.
Many new tests.
Numerous bug fixes¶
Python builtins can be called from Tcl-side tohil::call without resorting to explicitly specifying the builtins namespace.
Fixed bugs in how tclvars (tclobjs bound to vars) handled some methods, such as insert, pop, append, and extend.
Correct behavior of tclobj iterators, also fixes a crash.
If Python is initializing Tcl, it now does so using package require rather than a Tohil_Init to cause Tohil’s Tcl package code to get sourced. (It also requires the exact version of Tohil that it is, to reduce the risk of it loading some other version of the library when multiple versions are installed.)
Considerably improved documentation¶
We’ve considerably improved and extended the Tohil tutorial and reference, in Python-standard RST format, and are serving it out at https://flightaware.github.io/tohil-docs/