[issue14814] Implement PEP 3144 (the ipaddress module)

Terry J. Reedy report at bugs.python.org
Mon Jun 18 08:17:11 CEST 2012


Terry J. Reedy <tjreedy at udel.edu> added the comment:

> the interfaces of the v4 and v6 variants are deliberately very similar

I am hoping that means 'identical, once the obvious translations are made': v4 to v6, xxx.xxx.xxx.xxx to <whatever the v6 notation is>, and anything else?

> documenting everything twice seems like a rather user hostile thing to do.

Agreed. Please factor out common stuff. I see two choices.

1. Document in parallel after an intro explaining the translations

xxxx4yyyy(args)
xxxx6yyyy(args)
Return ... (either in 4 terms which user translate for 6 or generic terms).

# This might be better if you expect people to be doing one type of thing with both v4 and v6.


2. Document serially, first v4 stuff then v6 stuff (at present, though order might be reversed in the future ;-).

v4 stuff
-------
xxxx4yyyy(args)
Return ...

v6 stuff
-------
The following v6 functions are the same as the v4 functions above, except that ipv4address'es become ipv6address'es etc.
xxxx6uuuu(args)

# This might be better if you expect people to be doing multiple things with either v4 or v6, but not both.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14814>
_______________________________________


More information about the Python-bugs-list mailing list