Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating instance with Undefined is not meant to assign Undefined #33

Open
minrk opened this issue Mar 29, 2019 · 1 comment · May be fixed by #34
Open

creating instance with Undefined is not meant to assign Undefined #33

minrk opened this issue Mar 29, 2019 · 1 comment · May be fixed by #34

Comments

@minrk
Copy link
Contributor

minrk commented Mar 29, 2019

In traitlets, the Undefined sentinel is meant to be a placeholder for no value having been specified. However, some traittypes tests explicitly pass Undefined as the default value, paradoxically explicitly stating that a value has not been specified.

In traitlets 4.3, this results (I think incorrectly) in the value Undefined being set as the actual value of the trait. In traitlets master, the result on accessing the trait with Undefined value as an error, saying the value is undefined.

I'm not sure what use case these tests are meant to represent. Is it important to be able to explicitly store Undefined in traits? If so, it should probably be a different sentinel than the one in traitlets intended to mean "this has no value yet, fail on attempts to access it".

This was referenced Mar 29, 2019
@vidartf
Copy link
Member

vidartf commented Apr 2, 2019

It has been a while since I touched this, but at least in ipydatawidgets I think it might have been "significant" in order to work around the previous missing option of sending buffers with comm open messages from JS. I.e. I needed a way of saying "this will come later, do not create a default value yet".

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 a pull request may close this issue.

2 participants