Repository: plotly/dash

Issue:
[BUG] Auto-generated docstrings contain JS boolean values instead of Python boolean values
Prompted by https://github.com/plotly/dash-bio/pull/379#discussion_r297840872

While `true` and `false` are not capitalized in JavaScript, they are capitalized in Python. The Python components' docstrings should reflect this, since other JS types are "translated" into Python types (e.g., `PropTypes.shape` -> `dict`). 

Discussion:

Patch:
diff --git a/dash/development/_py_components_generation.py b/dash/development/_py_components_generation.py
index 3fcd96c8..61bfd9b2 100644
--- a/dash/development/_py_components_generation.py
+++ b/dash/development/_py_components_generation.py
@@ -436,6 +436,9 @@ def create_prop_docstring(prop_name, type_object, required, description,
     else:
         default = default['value']
 
+    if default in ['true', 'false']:
+        default = default.title()
+
     is_required = 'optional'
     if required:
         is_required = 'required'


Test patch:
diff --git a/tests/unit/development/test_base_component.py b/tests/unit/development/test_base_component.py
index c39fe9a7..c34c655d 100644
--- a/tests/unit/development/test_base_component.py
+++ b/tests/unit/development/test_base_component.py
@@ -1041,7 +1041,7 @@ def assert_flow_docstring(assertEqual, docstring):
             "Keyword arguments:",
             "- requiredString (string; required): A required string",
             "- optionalString (string; default ''): A string that isn't required.",
-            "- optionalBoolean (boolean; default false): A boolean test",
+            "- optionalBoolean (boolean; default False): A boolean test",
 
             "- optionalNode (a list of or a singular dash component, string or number; optional): "
             "A node test",