mirror of
https://github.com/davidhalter/jedi.git
synced 2026-08-13 08:11:01 +08:00
Don't print default "None" for Optional params
This commit is contained in:
@@ -378,6 +378,9 @@ class SignatureParamName(ParamNameInterface, AbstractNameDefinition):
|
|||||||
s = self._kind_string() + self.string_name
|
s = self._kind_string() + self.string_name
|
||||||
if self._signature_param.has_annotation:
|
if self._signature_param.has_annotation:
|
||||||
s += ': ' + self._signature_param.annotation_string
|
s += ': ' + self._signature_param.annotation_string
|
||||||
|
if re.fullmatch(r'Optional\[.+\]',
|
||||||
|
self._signature_param.annotation_string) is not None:
|
||||||
|
return s
|
||||||
if self._signature_param.has_default:
|
if self._signature_param.has_default:
|
||||||
s += '=' + self._signature_param.default_string
|
s += '=' + self._signature_param.default_string
|
||||||
return s
|
return s
|
||||||
|
|||||||
Reference in New Issue
Block a user