jupyter-widgets / pythreejs

A Jupyter - Three.js bridge
https://pythreejs.readthedocs.io
Other
936 stars 187 forks source link

Replaces CFloat class by CFloat() instances in __init__ methods #236 #238

Closed glyg closed 5 years ago

glyg commented 5 years ago

I assumed creating a global CFLOAT variable was ok? If not I'll change to the Undefined mecanism used for the default_value argument.

vidartf commented 5 years ago

There is some black magic going on in traitlets that set attributes on the traits pointing back to the containing HasTraits class. Given that this is used as a sub-trait, I'm not sure if there are any actual consequences to speak of, but I think it might be cleaner to use the Undefined pattern. Also, traits are only instantiated per-class, so there shouldn't be a notable performance impact.