[Python-Dev] PEP 3144 review. (original) (raw)
Peter Moody peter at hda3.com
Wed Sep 16 03:05:26 CEST 2009
- Previous message: [Python-Dev] PEP 3144 review.
- Next message: [Python-Dev] PEP 3144 review.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, Sep 15, 2009 at 6:02 PM, Eric Smith <eric at trueblade.com> wrote:
Antoine Pitrou wrote:
Peter Moody <peter hda3.com> writes:
However, I do not think that the proposed API should accept, eg, IPv4Network('192.168.1.1/24') as valid. That's just too confusing and error prone. Indeed, it should throw some kind of ValueError instead. Peter, what do you think? I disagree. It seems overly pedantic to throw a valueerror on this. IPy does (used to do?) this and it's one of the primary reasons I wrote ipaddr. Python is not PHP and does not try to be overly "smart" or tolerant when faced with bizarrely-formatted input. I don't see any valid reason for entering a network as "192.168.1.1/24" rather than the canonical "192.168.1.0/24". The former might indicate a typing error or a mental slip, so let's be helpful and signal it to the user. I completely agree. I don't know of any situation where I'd want a network of "192.168.1.1/24" to be anything other than an error.
when you're entering the address of your nic.
Eric.
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40hda3.com
- Previous message: [Python-Dev] PEP 3144 review.
- Next message: [Python-Dev] PEP 3144 review.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]