traitlets icon indicating copy to clipboard operation
traitlets copied to clipboard

A lightweight Traits like module

Results 139 traitlets issues
Sort by recently updated
recently updated
newest added

I recently had to completely disable trait notification during instantiation of a `HasTraits` child class. Holding with `hold_trait_notifications` wasn't sufficient; the notifications release when exiting the context manager was modifying...

Currently direct `HasTraits` subclasses warn when they receive unrecognized arguments: https://github.com/ipython/traitlets/blob/b0eaa6aa77e198cff68644a388400db850670c7d/tests/test_traitlets.py#L2802-L2810 However, this does not work with `Configurable` and its subclasses, although it is a subclass of `HasTraits`: https://github.com/ipython/traitlets/blob/b0eaa6aa77e198cff68644a388400db850670c7d/traitlets/config/configurable.py#L53 ![Image](https://github.com/user-attachments/assets/eb8e93c2-1a71-4724-b384-a19344dfca0f)...

When running the test suite with python 3.14, we get this failure due to improvement of error messages test log ``` ======================================================================= FAILURES ======================================================================= _______________________________________________________ TestArgcomplete.test_complete_simple_app _______________________________________________________ self = _KVArgParser(prog='python3.14...

I'm using `traitlets` version 5.14.3 and Python 3.12.3... In both cases below, a `TraitError` is not thrown, even though `None` is assigned to a `Unicode()` field after initialization... ```python from...

Please add support for a way to restrict keys on a `Dict`... Example of what should raise a `TraitError` ```python from traitlets import HasTraits, Dict, Unicode class Foo(HasTraits): # the...

I'm using `traitlets` version 5.14.3 and Python 3.12.3... - The error raised by `Dict()` with `per_key_traits` should specify the offending key name in the error. - The error raised by...

While much of the rest of the jupyter stack is blocked by difficult upstreams, traitlets likely could be test against 3.13t. [pytest-run-parallel](https://github.com/Quansight-Labs/pytest-run-parallel) could be added semi-transparently to the existing test...

This PR makes some of the container Traits generic. ## Resolves - #927 ### Before ### After

## Problem `traitlets.Set` currently lacks generic type support, making it impossible to specify the type of elements it contains for proper type checking. ## Current Situation ```python from traitlets import...