Aliasing#

register_alias#

tkclasswiz.aliasing.register_alias(cls: type, alias: str)#

Creates an alias name for type cls. Aliases will then be displayed in place of original name in:

  • Object definition “New” menu

  • Container values (e. g., inside Combobox)

Parameters:
  • cls (type) – The class (or function or type) to register an alias for.

  • alias (str) – The alias.

Example

from datetime import timedelta

register_alias(timedelta, "Duration")

get_aliased_name#

tkclasswiz.aliasing.get_aliased_name(class_) str | None#

Returns the class_’s aliased name. If class has no alias name, None is returned.