Re: Fwd: timedelta object recursion bug

2022-07-28 Thread Dieter Maurer
Please stay on the list (such that others can help, too) Ben Hirsig wrote at 2022-7-29 06:53 +1000: >Thanks for the replies, I'm just trying to understand why this would be >useful? > >E.g. why does max need a min/max/resolution, and why would these attributes >themselves need a min/max/resolution

Re: Fwd: timedelta object recursion bug

2022-07-28 Thread Dieter Maurer
Ben Hirsig wrote at 2022-7-28 19:54 +1000: >Hi, I noticed this when using the requests library in the response.elapsed >object (type timedelta). Tested using the standard datetime library alone >with the example displayed on >https://docs.python.org/3/library/datetime.html#examples-of-usage-timedel

Re: Fwd: timedelta object recursion bug

2022-07-28 Thread Jon Ribbens via Python-list
On 2022-07-28, Ben Hirsig wrote: > Hi, I noticed this when using the requests library in the response.elapsed > object (type timedelta). Tested using the standard datetime library alone > with the example displayed on > https://docs.python.org/3/library/datetime.html#examples-of-usage-timedelta >

Re: Fwd: timedelta object recursion bug

2022-07-28 Thread MRAB
On 28/07/2022 10:54, Ben Hirsig wrote: Hi, I noticed this when using the requests library in the response.elapsed object (type timedelta). Tested using the standard datetime library alone with the example displayed on https://docs.python.org/3/library/datetime.html#examples-of-usage-timedelta

Fwd: timedelta object recursion bug

2022-07-28 Thread Ben Hirsig
Hi, I noticed this when using the requests library in the response.elapsed object (type timedelta). Tested using the standard datetime library alone with the example displayed on https://docs.python.org/3/library/datetime.html#examples-of-usage-timedelta It appears as though the timedelta object

Re: Recursion bug...

2005-11-30 Thread ex_ottoyuhr
[EMAIL PROTECTED] wrote: > ex_ottoyuhr wrote: > > class TreeCommand: > > opcode = 0 > > children = [] > > def __init__(self, anOpcode) : > > opcode = anOpcode > > > opcode and children in this case is more like "class" variable in C++. > If you want "instance" variable, you nee

Re: Recursion bug...

2005-11-30 Thread ex_ottoyuhr
Devan L wrote: > Well, for one, in your __init__ method, you never do anything with > anOpcode. You simply assign the name 'opcode' to anOpcode. The reason > why everything is the same is that you're accessing > TreeCommand.children or Treecommand.opcode, which is shared by all > instances unles

Re: Recursion bug...

2005-11-30 Thread bonono
ex_ottoyuhr wrote: > class TreeCommand: > opcode = 0 > children = [] > def __init__(self, anOpcode) : > opcode = anOpcode > opcode and children in this case is more like "class" variable in C++. If you want "instance" variable, you need to do it as self.opcode, self.children, i

Re: Recursion bug...

2005-11-30 Thread Devan L
ex_ottoyuhr wrote: > To start with, I'm new at Python, so if this is something relatively > ordinary or a symptom of thinking in C++, I apologize... > > Anyhow, I'm currently trying to write a means of generating > genetic-programming functions in Python; the details would be a little > much for a

Recursion bug...

2005-11-30 Thread ex_ottoyuhr
To start with, I'm new at Python, so if this is something relatively ordinary or a symptom of thinking in C++, I apologize... Anyhow, I'm currently trying to write a means of generating genetic-programming functions in Python; the details would be a little much for a Usenet post, but suffice it to