Proposal: "Optional(Foo)" as a synonym for "Union(None, Foo)"
Open
easy
good first issue
priority: low
type: discussion
type: enhancement
- Dominant language
- Python
- Stars
- 462
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
It is common to have `Union` traits of the form `Union(None, )`. As a convenience to developers, and following a similar convention in Python's `typing` module, we should consider having `Optional()` as an alternative way of writing `Union(None, )`.
An alternative would be to make `allow_none` metadata universally accepted across `TraitType` instances.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.