Browse Source

Try to consistently use "inherit" vs "derive" in documentation.

pull/2014/head
Rapptz 6 years ago
parent
commit
c30a366106
  1. 2
      discord/errors.py
  2. 6
      discord/ext/commands/bot.py
  3. 8
      discord/ext/commands/core.py
  4. 10
      discord/ext/commands/errors.py
  5. 4
      discord/ext/commands/help.py

2
discord/errors.py

@ -130,7 +130,7 @@ class InvalidArgument(ClientException):
is invalid some way (e.g. wrong value or wrong type). is invalid some way (e.g. wrong value or wrong type).
This could be considered the analogous of ``ValueError`` and This could be considered the analogous of ``ValueError`` and
``TypeError`` except derived from :exc:`ClientException` and thus ``TypeError`` except inherited from :exc:`ClientException` and thus
:exc:`DiscordException`. :exc:`DiscordException`.
""" """
pass pass

6
discord/ext/commands/bot.py

@ -182,7 +182,7 @@ class BotBase(GroupMixin):
This function can either be a regular function or a coroutine. This function can either be a regular function or a coroutine.
Similar to a command :func:`.check`\, this takes a single parameter Similar to a command :func:`.check`\, this takes a single parameter
of type :class:`.Context` and can only raise exceptions derived from of type :class:`.Context` and can only raise exceptions inherited from
:exc:`.CommandError`. :exc:`.CommandError`.
Example Example
@ -255,7 +255,7 @@ class BotBase(GroupMixin):
This function can either be a regular function or a coroutine. This function can either be a regular function or a coroutine.
Similar to a command :func:`.check`\, this takes a single parameter Similar to a command :func:`.check`\, this takes a single parameter
of type :class:`.Context` and can only raise exceptions derived from of type :class:`.Context` and can only raise exceptions inherited from
:exc:`.CommandError`. :exc:`.CommandError`.
Example Example
@ -963,7 +963,7 @@ class Bot(BotBase, discord.Client):
pass pass
class AutoShardedBot(BotBase, discord.AutoShardedClient): class AutoShardedBot(BotBase, discord.AutoShardedClient):
"""This is similar to :class:`.Bot` except that it is derived from """This is similar to :class:`.Bot` except that it is inherited from
:class:`discord.AutoShardedClient` instead. :class:`discord.AutoShardedClient` instead.
""" """
pass pass

8
discord/ext/commands/core.py

@ -135,7 +135,7 @@ class Command(_BaseCommand):
checks checks
A list of predicates that verifies if the command could be executed A list of predicates that verifies if the command could be executed
with the given :class:`.Context` as the sole parameter. If an exception with the given :class:`.Context` as the sole parameter. If an exception
is necessary to be thrown to signal failure, then one derived from is necessary to be thrown to signal failure, then one inherited from
:exc:`.CommandError` should be used. Note that if the checks fail then :exc:`.CommandError` should be used. Note that if the checks fail then
:exc:`.CheckFailure` exception is raised to the :func:`.on_command_error` :exc:`.CheckFailure` exception is raised to the :func:`.on_command_error`
event. event.
@ -1336,7 +1336,7 @@ def has_permissions(**perms):
:class:`.discord.Permissions`. :class:`.discord.Permissions`.
This check raises a special exception, :exc:`.MissingPermissions` This check raises a special exception, :exc:`.MissingPermissions`
that is derived from :exc:`.CheckFailure`. that is inherited from :exc:`.CheckFailure`.
Parameters Parameters
------------ ------------
@ -1402,7 +1402,7 @@ def bot_has_permissions(**perms):
the permissions listed. the permissions listed.
This check raises a special exception, :exc:`.BotMissingPermissions` This check raises a special exception, :exc:`.BotMissingPermissions`
that is derived from :exc:`.CheckFailure`. that is inherited from :exc:`.CheckFailure`.
""" """
def predicate(ctx): def predicate(ctx):
guild = ctx.guild guild = ctx.guild
@ -1424,7 +1424,7 @@ def guild_only():
using the command. using the command.
This check raises a special exception, :exc:`.NoPrivateMessage` This check raises a special exception, :exc:`.NoPrivateMessage`
that is derived from :exc:`.CheckFailure`. that is inherited from :exc:`.CheckFailure`.
""" """
def predicate(ctx): def predicate(ctx):

10
discord/ext/commands/errors.py

@ -43,7 +43,7 @@ class CommandError(DiscordException):
This inherits from :exc:`discord.DiscordException`. This inherits from :exc:`discord.DiscordException`.
This exception and exceptions derived from it are handled This exception and exceptions inherited from it are handled
in a special way as they are caught and passed into a special event in a special way as they are caught and passed into a special event
from :class:`.Bot`\, :func:`on_command_error`. from :class:`.Bot`\, :func:`on_command_error`.
""" """
@ -237,7 +237,7 @@ class BadUnionArgument(UserInputError):
class ArgumentParsingError(UserInputError): class ArgumentParsingError(UserInputError):
"""An exception raised when the parser fails to parse a user's input. """An exception raised when the parser fails to parse a user's input.
This derives from :exc:`UserInputError`. There are child classes This inherits from :exc:`UserInputError`. There are child classes
that implement more granular parsing errors for i18n purposes. that implement more granular parsing errors for i18n purposes.
""" """
pass pass
@ -245,7 +245,7 @@ class ArgumentParsingError(UserInputError):
class UnexpectedQuoteError(ArgumentParsingError): class UnexpectedQuoteError(ArgumentParsingError):
"""An exception raised when the parser encounters a quote mark inside a non-quoted string. """An exception raised when the parser encounters a quote mark inside a non-quoted string.
This derives from :exc:`ArgumentParsingError`. This inherits from :exc:`ArgumentParsingError`.
Attributes Attributes
------------ ------------
@ -260,7 +260,7 @@ class InvalidEndOfQuotedStringError(ArgumentParsingError):
"""An exception raised when a space is expected after the closing quote in a string """An exception raised when a space is expected after the closing quote in a string
but a different character is found. but a different character is found.
This derives from :exc:`ArgumentParsingError`. This inherits from :exc:`ArgumentParsingError`.
Attributes Attributes
----------- -----------
@ -274,7 +274,7 @@ class InvalidEndOfQuotedStringError(ArgumentParsingError):
class ExpectedClosingQuoteError(ArgumentParsingError): class ExpectedClosingQuoteError(ArgumentParsingError):
"""An exception raised when a quote character is expected but not found. """An exception raised when a quote character is expected but not found.
This derives from :exc:`ArgumentParsingError`. This inherits from :exc:`ArgumentParsingError`.
Attributes Attributes
----------- -----------

4
discord/ext/commands/help.py

@ -770,7 +770,7 @@ class HelpCommand:
class DefaultHelpCommand(HelpCommand): class DefaultHelpCommand(HelpCommand):
"""The implementation of the default help command. """The implementation of the default help command.
This derives from :class:`HelpCommand`. This inherits from :class:`HelpCommand`.
It extends it with the following attributes. It extends it with the following attributes.
@ -973,7 +973,7 @@ class DefaultHelpCommand(HelpCommand):
class MinimalHelpCommand(HelpCommand): class MinimalHelpCommand(HelpCommand):
"""An implementation of a help command with minimal output. """An implementation of a help command with minimal output.
This derives from :class:`HelpCommand`. This inherits from :class:`HelpCommand`.
Attributes Attributes
------------ ------------

Loading…
Cancel
Save