1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Type .optional

This commit is contained in:
Steffo 2019-10-24 12:39:17 +02:00
parent d67110be09
commit b22215a93b

View file

@ -55,7 +55,7 @@ class CommandArgs(list):
raise InvalidInputError("Invalid syntax.") raise InvalidInputError("Invalid syntax.")
return match.groups() return match.groups()
def optional(self, index: int, default=None): def optional(self, index: int, default=None) -> typing.Optional[str]:
"""Get the argument at a specific index, but don't raise an error if nothing is found, instead returning the ``default`` value. """Get the argument at a specific index, but don't raise an error if nothing is found, instead returning the ``default`` value.
Parameters: Parameters: