Re: [Python-Dev] infinities

2006-11-27 Thread Adam Olsen
On 11/26/06, tomer filiba <[EMAIL PROTECTED]> wrote: > i found several places in my code where i use positive infinity > (posinf) for various things, i.e., > > > i like the concept, but i hate the "1e1" stuff... why not add > posint, neginf, and nan to the float type? i find it much more readab

Re: [Python-Dev] infinities

2006-11-26 Thread tomer filiba
> Um, you do realize that you're not going to be able to fit sys.maxint > strings into a list, right? i can multiply by four, thank you. of course i don't expect anyone to read a string *that* long. besides, this *particular example* isn't important, it was just meant to show why someone might wan

Re: [Python-Dev] infinities

2006-11-26 Thread Martin v. Löwis
tomer filiba schrieb: > okay, that would suffice. but why isn't it part of stdlib already? > the pep is three years old... it should either be rejected or accepted. > meanwhile, there are lots of missing API functions in the floating-point > implementation... It's not rejected because people keep

Re: [Python-Dev] infinities

2006-11-26 Thread Phillip J. Eby
At 07:07 PM 11/26/2006 +0200, tomer filiba wrote: > > sys.maxint makes more sense there. >no, it requires *infinity* to accomplish x - y == x; y != 0, for example: > >while limit > 0: > limit -= len(chunk) Um, you do realize that you're not going to be able to fit sys.maxint strings into a li

Re: [Python-Dev] infinities

2006-11-26 Thread Fredrik Lundh
tomer filiba wrote: > no, it requires *infinity* to accomplish x - y == x; y != 0, for example: > > while limit > 0: > limit -= len(chunk) > > with limit = posinf, the above code should be equivalent to "while True". that's a remarkably stupid way to count bytes. if you want to argue for

Re: [Python-Dev] infinities

2006-11-26 Thread tomer filiba
> sys.maxint makes more sense there. no, it requires *infinity* to accomplish x - y == x; y != 0, for example: while limit > 0: limit -= len(chunk) with limit = posinf, the above code should be equivalent to "while True". > There is already a PEP 754 for float constants okay, that would suff

Re: [Python-Dev] infinities

2006-11-26 Thread Bob Ippolito
On 11/26/06, tomer filiba <[EMAIL PROTECTED]> wrote: > i found several places in my code where i use positive infinity > (posinf) for various things, i.e., > > def readline(self, limit = -1): > if limit < 0: > limit = 1e1 # posinf > chars = [] > while lim

[Python-Dev] infinities

2006-11-26 Thread tomer filiba
i found several places in my code where i use positive infinity (posinf) for various things, i.e., def readline(self, limit = -1): if limit < 0: limit = 1e1 # posinf chars = [] while limit > 0: ch = self.read(1) chars.append(ch)