traitlets
traitlets copied to clipboard
A lightweight Traits like module
Benchmark results will come in a referring PR
Setting an attribute on a trait is slow, because we always trigger callbacks, even when they are not there. This speeds it up by 3x. Before: ``` ------------------------------------------------- benchmark: 1...
avoids need to define custom Trait subclasses just to define how strings are parsed, e.g. ```python class C(Configurable): path = List().tag(config=True, from_string=os.pathsep.split) ```
From: https://traitlets.readthedocs.io/en/latest/config.html#python-configuration-files > A __Config__ instance [...] is available inside the config file as __c__, and you simply set attributes on this. This preestablishment of an external global variable is...
We could probably significantly improve performance if we added `__slots__` to `HasTraits` and common `TraitType`. We'd just have to include `__dict__` as one of the slots to maintain backward compatibility.
Minimal example application: ```python from traitlets.config import Application from traitlets import Unicode class TestDash(Application): test = Unicode().tag(config=True) aliases = { "test": "TestDash.test", } def initialize(self, argv=None): self.parse_command_line(argv) def start(self): print(self.test)...
It would be very nice if the `ConfigLoader` class would support `toml` configuration files. Given that `toml.load()` returns `dict` object and the implementation for JSON exists, the changes should be...
``` pip show traitlets Name: traitlets Version: 5.0.5 ``` Calling `voila` with the `TagRemovePreprocessor.remove_cell_tags` option fails for a single tag: ``` voila notebook.ipynb --TagRemovePreprocessor.remove_cell_tags tag .... traitlets.traitlets.TraitError: The 'remove_cell_tags' trait...
After upgrading to 5.x I can no longer use the command I once was with voila - after having read through other issues and the docs I see the parsing...
I'm looking to start using a standard pattern in our UIs to split our model and views, similar to the points discussed in https://github.com/jupyter-widgets/ipywidgets/issues/2296. However when extending to more complex...