Re: [Python-Dev] Floor division

2007-01-25 Thread Tim Peters
[Tim Peters] >> ... >> Maybe we could introduce "%" as a unary prefix operator, where >> %x means "the fractional part of x" ;-) [Anders J. Munch] > What'ya talking about? Obviously it should be a suffix operator ;-) Na -- that would be confusing ;-) ... >> time.sleep(1.0 - math.fmod(now,

Re: [Python-Dev] Floor division

2007-01-25 Thread Tim Peters
[Armin Rigo] >> Thanks for the clarification. Yes, it makes sense that __mod__, >> __divmod__ and __floordiv__ on float and decimal would eventually follow >> the same path as for complex (where they make even less sense and >> already raise a DeprecationWarning). [Nick Maclaren] > Yes. Though t

Re: [Python-Dev] Floor division

2007-01-25 Thread Tim Peters
... [Tim] >> fractional part of x == fmod(x, 1.0) == modf(x)[0], so you could use >> either. [Anders J. Munch] > Actually, on the off chance that time.time() is negative, he can use > neither. It has to be math.ceil, float.__mod__ or divmod. If time.time() is negative, I expect this would be th

Re: [Python-Dev] Floor division

2007-01-25 Thread Tim Peters
[Armin] > Thanks for the clarification. Yes, it makes sense that __mod__, > __divmod__ and __floordiv__ on float and decimal would eventually follow > the same path as for complex (where they make even less sense and > already raise a DeprecationWarning). This truly has nothing to do with complex

Re: [Python-Dev] Floor division

2007-01-25 Thread Tim Peters
[Guido] > ... > I don't care about the speed, but having to import math (which I > otherwise almost never need) is a distraction, and (perhaps more so) I > can never remember whether it's modf() or fmod() that I want. fractional part of x == fmod(x, 1.0) == modf(x)[0], so you could use either. Si

Re: [Python-Dev] Floor division

2007-01-25 Thread Guido van Rossum
On 1/25/07, Tim Peters <[EMAIL PROTECTED]> wrote: > [Guido] > > The only thing I would miss about this is that I am used to write > > certain timing loops that like to sync on whole seconds, by taking > > time.time() % 1.0 which nicely gives me the milliseconds in the > > current second. E.g. > > >

Re: [Python-Dev] Having trouble committing

2007-01-25 Thread Neal Becker
I've heard it claimed that men often have this problem. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Having trouble committing

2007-01-25 Thread Brett Cannon
On 1/25/07, Tim Peters <[EMAIL PROTECTED]> wrote: > [Brett Cannon] > > I am trying to commit to the 2.5 branch and I am getting an error: > > > > svn: Commit failed (details follow): > > svn: Can't create directory > > '/data/repos/projects/db/transactions/53566-1.txn': Permission denied > > > > An

Re: [Python-Dev] Floor division

2007-01-25 Thread Tim Peters
[Guido] > The only thing I would miss about this is that I am used to write > certain timing loops that like to sync on whole seconds, by taking > time.time() % 1.0 which nicely gives me the milliseconds in the > current second. E.g. > > while True: > do_something_expensive_once_a_second_on_the_s

Re: [Python-Dev] Having trouble committing

2007-01-25 Thread Martin v. Löwis
Brett Cannon schrieb: > I am trying to commit to the 2.5 branch and I am getting an error: > > svn: Commit failed (details follow): > svn: Can't create directory > '/data/repos/projects/db/transactions/53566-1.txn': Permission denied > > Anyone know what is going on? It's not clear to me. The pe

Re: [Python-Dev] Having trouble committing

2007-01-25 Thread Tim Peters
[Brett Cannon] > I am trying to commit to the 2.5 branch and I am getting an error: > > svn: Commit failed (details follow): > svn: Can't create directory > '/data/repos/projects/db/transactions/53566-1.txn': Permission denied > > Anyone know what is going on? Did you do `svn info` in that directo

[Python-Dev] Having trouble committing

2007-01-25 Thread Brett Cannon
I am trying to commit to the 2.5 branch and I am getting an error: svn: Commit failed (details follow): svn: Can't create directory '/data/repos/projects/db/transactions/53566-1.txn': Permission denied Anyone know what is going on? -Brett ___ Python-De

Re: [Python-Dev] Floor division

2007-01-25 Thread Guido van Rossum
The only thing I would miss about this is that I am used to write certain timing loops that like to sync on whole seconds, by taking time.time() % 1.0 which nicely gives me the milliseconds in the current second. E.g. while True: do_something_expensive_once_a_second_on_the_second() now = time.

Re: [Python-Dev] Problem with signals in a single threaded application

2007-01-25 Thread Gustavo Carneiro
On 1/24/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: Gustavo Carneiro schrieb: >What about http://www.python.org/sf/1564547 ? It tries to solve a > different problem, but I think it also fixes this one; at least as much > as possible with the braindead unix signal programming interface.

Re: [Python-Dev] Floor division

2007-01-25 Thread Nick Maclaren
Armin Rigo <[EMAIL PROTECTED]> wrote: > > Thanks for the clarification. Yes, it makes sense that __mod__, > __divmod__ and __floordiv__ on float and decimal would eventually follow > the same path as for complex (where they make even less sense and > already raise a DeprecationWarning). Yes. Tho

Re: [Python-Dev] Floor division

2007-01-25 Thread Armin Rigo
Hi Tim, On Tue, Jan 23, 2007 at 05:14:29PM -0500, Tim Peters wrote: > For some reason `decimal` implemented __mod__ as the proposed > standard's "remainder" operation. That's the immediate source of your > surprise. IMO `decimal` should not have implemented __mod__ at all, > as Python's number-t