Re: [Python-Dev] conceptual clarity

2009-09-19 Thread David Harrison
2009/9/18 Peter Moody : > On Thu, Sep 17, 2009 at 6:17 PM, Andrew McNamara > wrote: >>>off to patch the pep and implement some of the non controversial changes. >> >> It might be a good idea to add some use-cases to the PEP. > > There are several use-cases in the PEP already. > > The problem is, f

Re: [Python-Dev] conceptual clarity

2009-09-18 Thread R. David Murray
On Thu, 17 Sep 2009 at 20:29, Peter Moody wrote: On Thu, Sep 17, 2009 at 6:17 PM, Andrew McNamara wrote: off to patch the pep and implement some of the non controversial changes. It might be a good idea to add some use-cases to the PEP. There are several use-cases in the PEP already. The p

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Steven D'Aprano
On Fri, 18 Sep 2009 01:29:21 pm Peter Moody wrote: > On Thu, Sep 17, 2009 at 6:17 PM, Andrew McNamara > > wrote: > >>off to patch the pep and implement some of the non controversial > >> changes. > > > > It might be a good idea to add some use-cases to the PEP. > > There are several use-cases in t

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Andrew McNamara
>> It might be a good idea to add some use-cases to the PEP. > >There are several use-cases in the PEP already. Maybe the use-cases deserve their own section in the PEP, or better yet, be pulled up into the Motivation section. >The problem is, for every use-case where one can show that the >exist

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Peter Moody
On Thu, Sep 17, 2009 at 6:17 PM, Andrew McNamara wrote: >>off to patch the pep and implement some of the non controversial changes. > > It might be a good idea to add some use-cases to the PEP. There are several use-cases in the PEP already. The problem is, for every use-case where one can show

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Steven D'Aprano
On Fri, 18 Sep 2009 11:41:32 am Andrew McNamara wrote: > The issue is bigger than error checking - I'm maintaining that a > distinction between an Address (singleton, item) and a Network > (Container) is useful and should be embraced. The current > implementation has already partially gone this ro

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread R. David Murray
On Fri, 18 Sep 2009 at 02:24, Sebastian Rittau wrote: On Thu, Sep 17, 2009 at 02:04:11PM -0400, R. David Murray wrote: I mean, eg, IPv4Network.fromHostIP('192.168.1.1/24'). I'd actually suggest to use >>> net, host = parse_network_and_host("192.168.111.33/24") (IPv4Network('192.168.111.0/2

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Andrew McNamara
>Again, the same error-catching functionality can be obtained through >an option to the constructor. network and broadcast attributes can be >renamed to .\1_address to alleviate confusion as well. > >I mentioned before that IPy's insistence on receiving masked out >networks was one of the main reas

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Andrew McNamara
>off to patch the pep and implement some of the non controversial changes. It might be a good idea to add some use-cases to the PEP. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Python-Dev mailing list Python-D

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Sebastian Rittau
On Thu, Sep 17, 2009 at 02:04:11PM -0400, R. David Murray wrote: > I mean, eg, IPv4Network.fromHostIP('192.168.1.1/24'). I'd actually suggest to use >>> net, host = parse_network_and_host("192.168.111.33/24") (IPv4Network('192.168.111.0/24'), IPv4Address('192.168.111.33')) >>> I think th

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread R. David Murray
On Fri, 18 Sep 2009 at 07:45, Nick Coghlan wrote: R. David Murray wrote: I would have IPv4Address itself be strict, and thus the new constructors would compute the network address and call the regular IPv4Address constructor.(*) s/Address/Network/ in this paragraph :) Ah, yes, sorry for the

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Nick Coghlan
R. David Murray wrote: > I would have IPv4Address itself be strict, and thus the new constructors > would compute the network address and call the regular IPv4Address > constructor.(*) s/Address/Network/ in this paragraph :) Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane,

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread R. David Murray
On Thu, 17 Sep 2009 at 10:38, Peter Moody wrote: On Thu, Sep 17, 2009 at 10:32 AM, R. David Murray wrote: On Thu, 17 Sep 2009 at 09:16, Peter Moody wrote: I mentioned before that IPy's insistence on receiving masked out networks was one of the main reasons I wrote ipaddr to begin with. Having

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Peter Moody
On Thu, Sep 17, 2009 at 10:32 AM, R. David Murray wrote: > On Thu, 17 Sep 2009 at 09:16, Peter Moody wrote: >> >> I mentioned before that IPy's insistence on receiving masked out >> networks was one of the main reasons I wrote ipaddr to begin with. >> Having ipaddr mimic this behavior would make i

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread R. David Murray
On Thu, 17 Sep 2009 at 09:16, Peter Moody wrote: I mentioned before that IPy's insistence on receiving masked out networks was one of the main reasons I wrote ipaddr to begin with. Having ipaddr mimic this behavior would make it significantly less useful. Removing functionality in the name of avo

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Peter Moody
On Thu, Sep 17, 2009 at 9:26 AM, Antoine Pitrou wrote: > Peter Moody hda3.com> writes: >> >> Again, the same error-catching functionality can be obtained through >> an option to the constructor. network and broadcast attributes can be >> renamed to .\1_address to alleviate confusion as well. > >

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Antoine Pitrou
Peter Moody hda3.com> writes: > > Again, the same error-catching functionality can be obtained through > an option to the constructor. network and broadcast attributes can be > renamed to .\1_address to alleviate confusion as well. My remark was not targetting error-catching of non-zero low bits

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Peter Moody
On Thu, Sep 17, 2009 at 5:32 AM, Nick Coghlan wrote: > Eric Smith wrote: >> Antoine Pitrou wrote: >>> As it is, -1 from me. Either we only keep two concepts (Address and >>>  Network), or if we introduce a third one (AddressWithMask, >>> whatever) for added practicality; but we shouldn't blur the

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread R. David Murray
On Thu, 17 Sep 2009 at 22:32, Nick Coghlan wrote: Eric Smith wrote: Antoine Pitrou wrote: As it is, -1 from me. Either we only keep two concepts (Address and Network), or if we introduce a third one (AddressWithMask, whatever) for added practicality; but we shouldn't blur the line between the

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Eric Smith
Nick Coghlan wrote: Eric Smith wrote: Antoine Pitrou wrote: As it is, -1 from me. Either we only keep two concepts (Address and Network), or if we introduce a third one (AddressWithMask, whatever) for added practicality; but we shouldn't blur the line between the two former canonical concepts

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Nick Coghlan
Eric Smith wrote: > Antoine Pitrou wrote: >> As it is, -1 from me. Either we only keep two concepts (Address and >> Network), or if we introduce a third one (AddressWithMask, >> whatever) for added practicality; but we shouldn't blur the line >> between the two former canonical concepts under the

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Eric Smith
Antoine Pitrou wrote: Le Thu, 17 Sep 2009 14:30:28 +1200, Greg Ewing a écrit : 3) an Address with an attached Network An Address could be constructed in three ways: Address(ip_number) Address(ip_number, network = ) Address(ip_number, mask = ) # constructs and attaches a suitabl

[Python-Dev] conceptual clarity

2009-09-17 Thread Antoine Pitrou
Le Thu, 17 Sep 2009 14:30:28 +1200, Greg Ewing a écrit : > > 3) an Address with an attached Network > > An Address could be constructed in three ways: > >Address(ip_number) > >Address(ip_number, network = ) > >Address(ip_number, mask = ) > # constructs and attaches a suitably-