Survey: improving the Python std lib docs

Michael Torrie torriem at gmail.com
Wed May 17 18:11:24 EDT 2017


On 05/17/2017 02:31 PM, Ned Batchelder wrote:
> Can you give an example of such a method? Often, that signature is used
> because there is no pre-conception of what the arguments might be.

I'm not sure if this afflicts the standard library, but in my own code,
since Python doesn't support constructors with different signatures, you
pretty much have to rely on kwargs with __init__() to handle different
permutations of construction arguments.  Not that we don't know what the
arguments might be, we just don't know which of them we'll have to deal
with.  Maybe the standard library is better designed than my own code,
but I find I have to implement __init__(self, **kwargs) all the time.



More information about the Python-list mailing list