[Python-3000] IPv6 address tuple

"Martin v. Löwis" martin at v.loewis.de
Sat Mar 24 11:57:06 CET 2007


> The problem is that people do unpack the tuple a lot of the time as the
> first thing when they get the address. I suppose the elements are
> sometimes later used for things like logging and debug output. Also
> people are used to conceptually destructuring the address as "host,
> port" in their heads so it's logical to unpack it.

If that is the issue, a object that unpacks as a two-tuple, but has
additional named fields (i.e. a StructSequence) may be an option.

Regards,
Martin



More information about the Python-3000 mailing list