[docs] [issue14586] TypeError: truncate() takes no keyword arguments

R. David Murray report at bugs.python.org
Mon Apr 16 22:01:57 CEST 2012

R. David Murray <rdmurray at bitdance.com> added the comment:

I think you misunderstand the way that python arguments work.  If you have a function so:

  def func(size=None):

Then func(0) and func(size=0) are equivalent, and func(0, size=0) is a TypeError because you've provided two arguments instead of just one.  The C code *can* emulate this, but often doesn't (it just accepts positional arguments instead).  An issue was raised about changing most C functions to support the keyword syntax, but I believe it was decided that while in general doing so is good we'd only do it on a case by case basis as they came up.  See issue 8706 for more details.


Python tracker <report at bugs.python.org>

More information about the docs mailing list