Skip to content

Conversation

@bluescarni
Copy link
Contributor

A small extension that enables numtraits to be nullable (i.e., None can be assigned to a trait) and to be constructed with a default value.

numtraits.py Outdated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the default_value argument default to? Can you have just one super call and adapt the value of default appropriately?

@SylvainCorlay
Copy link

The base trait_type has a allow_none property, which should already do what you are trying to do.

@bluescarni
Copy link
Contributor Author

@SylvainCorlay right, I was not sure it was part of the public API. I am reimplementing the functionality to take advantage of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants