Stephen J. Turnbull <stephen <at> xemacs.org> writes: > > Rather, don't you want to just give IPv4Address an attribute > 'network'? This could then be filled in by the indexing method on > IPv4Network.
It doesn't make sense to me. An address, conceptually, doesn't have a "network". If I say "213.5.4.68", it isn't part of a specific network /a priori/. Not only doesn't it make sense to me, but it creates ambiguities. Do two similar addresses, but with different "networks", compare and hash equally? Both answers are unsatisfactory and will create nasty surprises for users. I don't see what's difficult in remembering the network object by yourself if you need it. Python is not Java, it has lightweight syntax, useful datatypes and notations (e.g. tuples). You don't need to have every use case taken care of by a dedicated library API. (to make an analogy: if I take an item from a list, it doesn't hold a reference to the list just in case it might be practical to do so) Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com