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

Base component __repr__ logic is wrong. #491

Open
rmarren1 opened this issue Dec 14, 2018 · 1 comment
Open

Base component __repr__ logic is wrong. #491

rmarren1 opened this issue Dec 14, 2018 · 1 comment

Comments

@rmarren1
Copy link
Contributor

Base component __repr__ is broken. It assumed that _prop_names[0] is always children, which is not true.

This breaks some things, for example if a component does not have children and thus its first prop is id, it will print the id as the first positional argument rather than a proper keyword argument. This is mostly relevant for dash-html-components.

For example:

Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dash_core_components as dcc
>>> dcc.RadioItems(id='hello') 
RadioItems('hello')
>>> import dash_html_components as html
>>> html.Div(id='hello')
Div(id='hello')
@rmarren1
Copy link
Contributor Author

rmarren1 commented Dec 14, 2018

will fix in upcoming PR for #311

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

No branches or pull requests

3 participants
@Marc-Andre-Rivet @rmarren1 and others