A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-August/091381.html below:

IP Address Manipulation Library for the Python Standard Library

[Python-Dev] PEP 3144: IP Address Manipulation Library for the Python Standard Library [Python-Dev] PEP 3144: IP Address Manipulation Library for the Python Standard LibraryAntoine Pitrou solipsis at pitrou.net
Wed Aug 26 21:02:28 CEST 2009
Martin v. Löwis <martin <at> v.loewis.de> writes:
> [...]
> Then, class IPAddress has a method reverse_dns, which is defined
> as
> 
>     def reverse_dns(self):
>         """The reverse DNS lookup record for this IP address"""
>         return self._module.int_to_arpa(self._value)
> 
> So IPv4 addresses and IPv6 addresses share the same class, but instances
> have different values of _module.

Ok, thanks for the explanation. It looks like an inheritance-based approach
would allow for easier and more traditional introspection (e.g. `isinstance(ip,
IPv4Address)`). Not to mention that avoiding an indirection level can make
things faster.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4