Skip to content

Commit 1c94fd2

Browse files
authored
Merge pull request #450 from plotly/remove-keywords
Use all python keywords when checking if prop name is valid
2 parents 09f551a + 06f848f commit 1c94fd2

File tree

6 files changed

+53
-5
lines changed

6 files changed

+53
-5
lines changed

Diff for: .circleci/requirements/dev-requirements-py37.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dash_core_components>=0.35.1
1+
dash_core_components==0.35.1
22
dash_html_components==0.12.0rc3
33
dash-flow-example==0.0.3
44
dash-dangerously-set-inner-html

Diff for: .circleci/requirements/dev-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dash_core_components>=0.35.1
1+
dash_core_components==0.35.1
22
dash_html_components>=0.12.0rc3
33
dash_flow_example==0.0.3
44
dash-dangerously-set-inner-html

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.28.7 - 2018-11-05
2+
## Fixed
3+
- Component generation now uses the same prop name black list in all supported Python versions. Closes [#361](https://github.com/plotly/dash/issues/361). [#450](https://github.com/plotly/dash/pull/450)
4+
15
## 0.28.6 - 2018-11-05
26
## Fixed
37
- `Dash.registered_paths` changed to a `collections.defaultdict(set)`, was appending the same package paths on every index. [#443](https://github.com/plotly/dash/pull/443)

Diff for: dash/development/_all_keywords.py

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This is a set of Python keywords that cannot be used as prop names.
2+
# Keywords for a particular version are obtained as follows:
3+
# >>> import keyword
4+
# >>> keyword.kwlist
5+
6+
kwlist = set([
7+
'and',
8+
'elif',
9+
'is',
10+
'global',
11+
'as',
12+
'in',
13+
'if',
14+
'from',
15+
'raise',
16+
'for',
17+
'except',
18+
'nonlocal',
19+
'pass',
20+
'finally',
21+
'print',
22+
'import',
23+
'True',
24+
'None',
25+
'return',
26+
'exec',
27+
'await',
28+
'else',
29+
'break',
30+
'not',
31+
'with',
32+
'class',
33+
'assert',
34+
'False',
35+
'yield',
36+
'try',
37+
'while',
38+
'continue',
39+
'del',
40+
'async',
41+
'or',
42+
'def',
43+
'lambda'
44+
])

Diff for: dash/development/base_component.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import copy
33
import os
44
import inspect
5-
import keyword
5+
from ._all_keywords import kwlist
66

77

88
def is_number(s):
@@ -380,7 +380,7 @@ def __repr__(self):
380380
'{:s}=Component.UNDEFINED'.format(p))
381381
for p in prop_keys
382382
if not p.endswith("-*") and
383-
p not in keyword.kwlist and
383+
p not in kwlist and
384384
p not in ['dashEvents', 'fireEvent', 'setProps']] + ['**kwargs']
385385
)
386386

Diff for: dash/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.28.6'
1+
__version__ = '0.28.7'

0 commit comments

Comments
 (0)