update docstrings in cpp_generator.py (#6212)

This commit is contained in:
NP v/d Spek 2024-02-11 22:08:32 +01:00 committed by GitHub
parent 3eaf59cc5a
commit 71b3a14a29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -478,7 +478,7 @@ def variable(
:param type_: Manually define a type for the variable, only use this when it's not possible :param type_: Manually define a type for the variable, only use this when it's not possible
to do so during config validation phase (for example because of template arguments). to do so during config validation phase (for example because of template arguments).
:returns The new variable as a MockObj. :return: The new variable as a MockObj.
""" """
assert isinstance(id_, ID) assert isinstance(id_, ID)
rhs = safe_exp(rhs) rhs = safe_exp(rhs)
@ -526,7 +526,7 @@ def new_variable(id_: ID, rhs: SafeExpType, type_: "MockObj" = None) -> "MockObj
:param type_: Manually define a type for the variable, only use this when it's not possible :param type_: Manually define a type for the variable, only use this when it's not possible
to do so during config validation phase (for example because of template arguments). to do so during config validation phase (for example because of template arguments).
:returns The new variable as a MockObj. :return: The new variable as a MockObj.
""" """
assert isinstance(id_, ID) assert isinstance(id_, ID)
rhs = safe_exp(rhs) rhs = safe_exp(rhs)
@ -549,7 +549,7 @@ def Pvariable(id_: ID, rhs: SafeExpType, type_: "MockObj" = None) -> "MockObj":
:param type_: Manually define a type for the variable, only use this when it's not possible :param type_: Manually define a type for the variable, only use this when it's not possible
to do so during config validation phase (for example because of template arguments). to do so during config validation phase (for example because of template arguments).
:returns The new variable as a MockObj. :return: The new variable as a MockObj.
""" """
rhs = safe_exp(rhs) rhs = safe_exp(rhs)
obj = MockObj(id_, "->") obj = MockObj(id_, "->")
@ -570,7 +570,7 @@ def new_Pvariable(id_: ID, *args: SafeExpType) -> Pvariable:
:param id_: The ID used to declare the variable (also specifies the type). :param id_: The ID used to declare the variable (also specifies the type).
:param args: The values to pass to the constructor. :param args: The values to pass to the constructor.
:returns The new variable as a MockObj. :return: The new variable as a MockObj.
""" """
if args and isinstance(args[0], TemplateArguments): if args and isinstance(args[0], TemplateArguments):
id_ = id_.copy() id_ = id_.copy()