[Python-ideas] Conventions for function annotations

Barry Warsaw barry at python.org
Mon Dec 3 16:34:16 CET 2012


On Dec 03, 2012, at 09:08 PM, Nick Coghlan wrote:

>I would be *quite delighted* if people are open to the idea of making a
>much stronger recommendation along the following lines explicit in PEP 8:

I am -1 for putting any of what followed in PEP 8, and in fact, I think the
existing examples at the bottom of PEP 8 are inappropriate.

PEP 8 should be prescriptive of explicit Python coding styles.  Think "do
this, not that".  It should be as minimal as possible, and in general provide
rules that can be easily referenced and perhaps automated (e.g. pep8.py).

Some of the existing text in PEP 8 already doesn't fall under that rubric, but
it's close enough (e.g. designing for inheritance).

I don't think annotations reach the level of consensus or practical experience
needed to be added to PEP 8.

OTOH, I wouldn't oppose a new informational PEP labeled "Annotations Best
Practices", where some of these principles can be laid out and explored.

Cheers,
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121203/a08cad77/attachment.pgp>


More information about the Python-ideas mailing list