[Python-ideas] BindError as a built-in TypeError subclass (on the margin of PEP 362 discussion)

Ben Finney ben+python at benfinney.id.au
Mon Jun 11 00:12:29 CEST 2012

Nick Coghlan <ncoghlan at gmail.com> writes:

> On Sun, Jun 10, 2012 at 10:00 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> > My concept is that errors due to the wrong argument count, duplicate
> > or missing keyword arguments, etc. which currently raise TypeError
> > could raise ArgumentError, a subclass, instead.
> >
> > That will make distinguishing between "passed the wrong number of
> > arguments" from "passed the wrong type of argument" easier.
> This is actually why I prefer "BindError" to the name "ArgumentError".
> The former is explicit about what has gone wrong: the supplied
> arguments could not be bound to the parameters expected by the
> supplied callable.

“ArgumentBindError”, then?

 \     “Airports are ugly. Some are very ugly. Some attain a degree of |
  `\        ugliness that can only be the result of a special effort.” |
_o__)             —Douglas Adams, _The Long Dark Tea-Time Of The Soul_ |
Ben Finney

More information about the Python-ideas mailing list