File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ classifiers = [
30
30
dependencies = [
31
31
" ipywidgets>=8.0.0" ,
32
32
" numpy<2.0.0" ,
33
- " widget_code_input>=4.0.13 " ,
33
+ " widget_code_input @ git+https://github.com/agoscinski/widget-code-input@remove-docstring " ,
34
34
" matplotlib" ,
35
35
" termcolor"
36
36
]
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ def __init__(
71
71
if function_name is None :
72
72
raise ValueError ("function_name must be given if no function is given." )
73
73
function_parameters = "" if function_parameters is None else function_parameters
74
- docstring = "\n " if docstring is None else docstring
75
74
function_body = "" if function_body is None else function_body
76
75
self ._builtins = {} if builtins is None else builtins
77
76
super ().__init__ (
@@ -152,9 +151,9 @@ def function_parameters_name(self) -> List[str]:
152
151
return self .function_parameters .replace ("," , "" ).split (" " )
153
152
154
153
@staticmethod
155
- def get_docstring (function : types .FunctionType ) -> str :
154
+ def get_docstring (function : types .FunctionType ) -> str | None :
156
155
docstring = function .__doc__
157
- return "" if docstring is None else textwrap .dedent (docstring )
156
+ return None if docstring is None else textwrap .dedent (docstring )
158
157
159
158
@staticmethod
160
159
def _get_function_source_and_def (
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ def test_get_function_paramaters(self):
69
69
assert CodeInput .get_function_parameters (self .mock_function_7 ) == "x, **kwargs"
70
70
71
71
def test_get_docstring (self ):
72
+ assert CodeInput .get_docstring (self .mock_function_0 ) is None
72
73
assert (
73
74
CodeInput .get_docstring (self .mock_function_1 )
74
75
== "\n This is an example function.\n It adds two numbers.\n "
You can’t perform that action at this time.
0 commit comments