enthought / envisage

Envisage is a Python-based framework for building applications whose functionalities can be extended by adding "plug-ins".
http://docs.enthought.com/envisage/
Other
82 stars 26 forks source link

Include lazy defaults in query evaluation for get_service(s) #445

Closed aaronayres35 closed 1 year ago

aaronayres35 commented 3 years ago

closes #140

This PR goes through the editable_traits on a service and access them. This forces lazy defaults to be evaluated so that they end up in the service's __dict__ which is then used in the namespace for making queries.

mdickinson commented 1 year ago

I don't think this is the way we want to go: accessing those traits may have unintended side-effects, or take a long time computationally.

I think we want something more dynamic here, where only the traits mentioned in a property are accessed; that would obviously require a bit more work to implement. Ideally, we'd find a solution that avoids the need for eval altogether, either by restricting the allowed expressions and parsing them ourselves, or by using a general selection callable instead of evaluating a string.

mdickinson commented 1 year ago

@aaronayres35 Do you still have a need for the associated issue to be solved? If so, we can look into other possible solutions; if not, I'll close this PR (but leave the issue open, of course).

aaronayres35 commented 1 year ago

@aaronayres35 Do you still have a need for the associated issue to be solved? If so, we can look into other possible solutions; if not, I'll close this PR (but leave the issue open, of course).

No, no need. Feel free to close

mdickinson commented 1 year ago

Thanks, @aaronayres35. Closing.