[Python-Dev] The docstring hack for signature information has to go

Stefan Krah stefan at bytereef.org
Mon Feb 3 17:05:48 CET 2014

Larry Hastings <larry at hastings.org> wrote:
> So here's the problem.  Let's say you want to write an extension that will work
> with Python 3.3 and 3.4, using the stable ABI.  If you don't add this line,
> then in 3.4 you won't have introspection information, drat.  But if you *do*
> add this line, your docstring will look mildly stupid in 3.3, because it'll
> have this unsightly "sig=(" line at the top.  And it *won't* have a nice
> handwritten docstring.  (And if you added both a sig= signature *and* a
> handwritten signature, in 3.4 it would display both.  That would also look
> dumb.)

I think we may slowly get into PEP territory here.  Just imagine that
we settle on X, then decide at a later point to have a standard way of
adding type annotations, then find that X does not work because of (unknown).

I'm mentioning this because signatures get really interesting for me
if they contain type information.

Stefan Krah

More information about the Python-Dev mailing list