[Python-Dev] Confirming status of new modules in 3.4

Nick Coghlan ncoghlan at gmail.com
Sat Mar 15 16:55:18 CET 2014


On 16 March 2014 01:40, Guido van Rossum <guido at python.org> wrote:
> On Sat, Mar 15, 2014 at 4:02 AM, Giampaolo Rodola' <g.rodola at gmail.com>
> wrote:
>
> This downside of using subclassing as an API should be well known by now and
> widely warned against.

I've actually pondered the idea of suggesting we explicitly recommend
the "procedural facade around an object oriented implementation" API
design model in PEP 8, but it's not really a *coding* style guide
issue, and I also haven't been able to come up with a good way of
summarising it.

That said, should we perhaps start codifying some of these principles
as a "standard library API design guide"? We have a few additional
issues to take into account that most software can ignore, like
"assume that users that already know Python may be using the module
and its documentation to learn a new domain, rather than the other way
around, where a domain expert is just using the module to get things
done". (That was the main driver for the differences between ipaddr
and the accepted ipaddress API). The question about whether or not to
add new boolean flags vs adding new APIs also comes up fairly often.

At the moment, there's no real way for newcomers to pick up those
principles other than hanging around long enough to see them come up
again.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list