[Python-Dev] PEP 3144: IP Address Manipulation Library for the Python Standard Library (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Wed Aug 26 21:02:28 CEST 2009
- Previous message: [Python-Dev] PEP 3144: IP Address Manipulation Library for the Python Standard Library
- Next message: [Python-Dev] PEP 3144: IP Address Manipulation Library for the Python Standard Library
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Martin v. Löwis <martin v.loewis.de> writes:
[...] Then, class IPAddress has a method reversedns, which is defined as
def reversedns(self): """The reverse DNS lookup record for this IP address""" return self.module.inttoarpa(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.
- Previous message: [Python-Dev] PEP 3144: IP Address Manipulation Library for the Python Standard Library
- Next message: [Python-Dev] PEP 3144: IP Address Manipulation Library for the Python Standard Library
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]