ipaddress (was: Re: for a 'good python')

2023-04-21 Thread Simon Ward
On Thu, Apr 13, 2023 at 04:00:59PM +0100, Barry wrote: Ipaddress was developed outside of the std lib and later added i recall. I used it prior to it being in the standard library: https://pypi.org/project/ipaddr/ Simon -- A complex system that works is invariably found to have evolved from a

Re: for a 'good python'

2023-04-13 Thread Dennis Lee Bieber
On Thu, 13 Apr 2023 00:21:58 +0200, jak declaimed the following: >Thank you too. I had seen this library but I always try not to use >libraries outside the standard ones. Now I don't remember why I was >convinced that this wasn't part of it, perhaps because it was like that >at the time or becau

Re: for a 'good python'

2023-04-13 Thread jak
Dennis Lee Bieber ha scritto: On Thu, 13 Apr 2023 00:21:58 +0200, jak declaimed the following: Thank you too. I had seen this library but I always try not to use libraries outside the standard ones. Now I don't remember why I was convinced that this wasn't part of it, perhaps because it was l

Re: for a 'good python'

2023-04-13 Thread Barry
 > On 13 Apr 2023, at 00:19, jak wrote: > > Barry ha scritto: >>  On 12 Apr 2023, at 18:10, jak wrote: >>> Hi everyone, >>> some time ago I wrote a class to determine if an ipv4 address belonged >>> to a subnet. Seldom using python I'm pretty sure it's not written in >>> 'good python'

Re: for a 'good python'

2023-04-13 Thread Lars Liedtke
Lars Liedtke Software Entwickler [Tel.] +49 721 98993- [Fax] +49 721 98993- [E-Mail]l...@solute.de solute GmbH Zeppelinstraße 15 76185 Karlsruhe Germany [Logo Solute] Marken der solute GmbH | brands of solute GmbH [Marken] [Advertising Partner] Geschäft

Re: for a 'good python'

2023-04-12 Thread jak
Barry ha scritto:  On 12 Apr 2023, at 18:10, jak wrote: Hi everyone, some time ago I wrote a class to determine if an ipv4 address belonged to a subnet. Seldom using python I'm pretty sure it's not written in 'good python' nor too portable. Could you give me some advice to make it better?

Re: for a 'good python'

2023-04-12 Thread Barry
 > On 12 Apr 2023, at 18:10, jak wrote: > Hi everyone, > some time ago I wrote a class to determine if an ipv4 address belonged > to a subnet. Seldom using python I'm pretty sure it's not written in > 'good python' nor too portable. Could you give me some advice to make it > better? > > class

Re: for a 'good python'

2023-04-12 Thread jak
Stefan Ram ha scritto: jak writes: @property def subnet(self): return self.__to_str(self.__tsubnet) Maybe each of those attributes should be an object of a special class where your "__to_str" is "__str__"? E.g., # code in "calcip.__init__" self.tsubnet = ip_address_class.from_int(