File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ classifiers = [
3030dependencies = [
3131 " ipywidgets>=8.0.0" ,
3232 " 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 " ,
3434 " matplotlib" ,
3535 " termcolor"
3636]
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ def __init__(
7171 if function_name is None :
7272 raise ValueError ("function_name must be given if no function is given." )
7373 function_parameters = "" if function_parameters is None else function_parameters
74- docstring = "\n " if docstring is None else docstring
7574 function_body = "" if function_body is None else function_body
7675 self ._builtins = {} if builtins is None else builtins
7776 super ().__init__ (
@@ -152,9 +151,9 @@ def function_parameters_name(self) -> List[str]:
152151 return self .function_parameters .replace ("," , "" ).split (" " )
153152
154153 @staticmethod
155- def get_docstring (function : types .FunctionType ) -> str :
154+ def get_docstring (function : types .FunctionType ) -> str | None :
156155 docstring = function .__doc__
157- return "" if docstring is None else textwrap .dedent (docstring )
156+ return None if docstring is None else textwrap .dedent (docstring )
158157
159158 @staticmethod
160159 def _get_function_source_and_def (
Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ def test_get_function_paramaters(self):
6969 assert CodeInput .get_function_parameters (self .mock_function_7 ) == "x, **kwargs"
7070
7171 def test_get_docstring (self ):
72+ assert (
73+ CodeInput .get_docstring (self .mock_function_0 ) is None
74+ )
7275 assert (
7376 CodeInput .get_docstring (self .mock_function_1 )
7477 == "\n This is an example function.\n It adds two numbers.\n "
You can’t perform that action at this time.
0 commit comments