enthought / enthought/traits

Allow specification of an adaptation manager in the Supports Trait type

Open
#482 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
462
Forks
90
PR merge metrics
No merged PRs in 30d

Description

The `Supports` Trait type (a.k.a. the `AdaptedTo` Trait type) currently always uses the global adaptation manager to perform any necessary adaptations. That choice is hard-coded in the use of the `adapts` function, [here](https://github.com/enthought/traits/blob/master/traits/trait_types.py#L3091)

Using the global adaptation manager isn't ideal, but it's okay as a default. But using the global adaptation manager without any easy way to specify an alternative adaptation manager is far from ideal.

It would be useful to have some mechanism to allow the `Supports` Trait type (or an equivalent replacement Trait type) to use an adaptation manager other than the global one. I can think of a couple of ways of doing this (e.g., an `adaptation_manager="my_adaptation_manager"`) piece of metadata, where "my_adaptation_manager" is a trait name), but haven't looked at the options seriously yet.

With the current state of affairs, I'd simply recommend never using the `Supports` trait in real application code.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.