enthought / enthought/traits

Remove 'except Exception' guard from `TraitType.clone`

Open
#1,696 0 comments 0 reactions 0 assignees View on GitHub
component: core type: refactor
Dominant language
Python
Stars
462
Forks
90
PR merge metrics
No merged PRs in 30d

Description

[From #1645]

Currently, in most cases `TraitType.clone` with a new default value tries to validate that default value using `self.validate(None, None, default_value)`. This can fail for trait types like `This` which need a proper object and name for correct validation, so this code executes inside a `try / except Exception` wrapper.

Those trait types should override `clone` to implement their own behaviour, and then we can remove the catch-all-exceptions logic.

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.