Is there a canonical way to check whether an iterable is ordered?

2014-09-18 Thread cool-RR
My function gets an iterable of an unknown type. I want to check whether it's ordered. I could check whether it's a `set` or `frozenset`, which would cover many cases, but I wonder if I can do better. Is there a nicer way to check whether an iterable is ordered or not? Thanks, Ram. -- https:

Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))`

2014-09-18 Thread cool-RR
On Thursday, September 18, 2014 6:12:08 AM UTC+3, Steven D'Aprano wrote: > cool-RR wrote: > > Chris, why is this invariant `div*y + mod == x` so important? Maybe it's > > more important to return a mathematically reasonable result for the the > > floor-divisi

Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))`

2014-09-17 Thread cool-RR
On Wednesday, September 17, 2014 6:30:04 PM UTC+3, Chris Angelico wrote: > On Thu, Sep 18, 2014 at 1:16 AM, cool-RR wrote: > > I didn't ask for the modulo, I agree it should remain NaN. I'm talking > > about the floor division. > > Invariant: div*y + mod ==

Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))`

2014-09-17 Thread cool-RR
On Wednesday, September 17, 2014 6:10:35 PM UTC+3, Chris Angelico wrote: > On Thu, Sep 18, 2014 at 12:55 AM, cool-RR wrote: > > Terry, that doesn't really answer the question "why", it just pushes it > > back to the documentation. Is there a real answer why? Why

Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))`

2014-09-17 Thread cool-RR
Terry, that doesn't really answer the question "why", it just pushes it back to the documentation. Is there a real answer why? Why return NaN when Inf would make mathematical sense? On Wednesday, September 17, 2014 4:13:38 AM UTC+3, Terry Reedy wrote: > On 9/16/2014 5:40

Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))`

2014-09-16 Thread cool-RR
While debugging my code I found that the bug was because I assumed that something like `divmod(float('inf'), 1)` would be equal to `(float('inf'), float('nan'))`, while Python returns `(float('nan'), float('nan'))`. Why does Python make the division result be NaN in this case? `float('inf') / 1`

Using asyncio workers in a `concurrent.futures` interface

2014-08-12 Thread cool-RR
Hello everybody! I have a question. I have a Django app running on Heroku. I need to run about 100 worker threads there to do uploads/downloads simultaneously. A Heroku Dyno has only 512MB of memory, so I'm reluctant to run 100 worker threads. (I've had Dynos crash from lack of memory when usi

Specifying `blocking` and `timeout` when acquiring lock as a context manager

2014-08-08 Thread cool-RR
Hi all, If I want to acquire a `threading.Lock` using the context manager protocol, is it possible to specify the `blocking` and `timeout` arguments that `acquire` would usually take? Thanks, Ram. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-22 Thread cool-RR
On Saturday, March 22, 2014 3:39:21 AM UTC+2, Terry Reedy wrote: > Does your .b2 install work? Can you delete it thru the programs list? I uninstalled it before this entire adventure. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
On Saturday, March 22, 2014 12:25:03 AM UTC+2, Chris Angelico wrote: > (First and a halfth question: When you say "won't install", exactly > what do you mean? For completeness, I'll answer this question I forgot to answer, in case someone still wants to investigate: It just showed the first dialo

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
On Saturday, March 22, 2014 12:42:56 AM UTC+2, Chris Angelico wrote: > I think you should follow the internet version of Hanlon's Razor here: > Damaged transmission before deliberate tampering. :) It's far more > likely something simply got misdownloaded, and your guess about > timezones is the mos

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
Here's the offending MSI, if anyone wants to investigate: https://dl.dropboxusercontent.com/u/1927707/python-3.4.0.amd64.msi On Saturday, March 22, 2014 12:34:06 AM UTC+2, cool-RR wrote: > I did download from python.org. I checked the md5, it was incorrect, then I > downloaded again

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
is doing in the Python MSI. (I'm guessing it's timezone-related, but it's still far-fetched, because why would an obscure time zone file appear in the MSI log?) On Saturday, March 22, 2014 12:25:03 AM UTC+2, Chris Angelico wrote: > On Sat, Mar 22, 2014 at 9:05 AM, cool-RR w

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
Sorry, couldn't attach the file, here's the log file: https://gist.github.com/anonymous/9697505 On Saturday, March 22, 2014 12:05:59 AM UTC+2, cool-RR wrote: > Hi everybody, > > > > I need to install Python 3.4 final urgently, because my IDE stopped > supporting

Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
Hi everybody, I need to install Python 3.4 final urgently, because my IDE stopped supporting Python 3.4 beta2, and I need it urgently to work. I downloaded it, but the MSI won't install. It didn't work on both of my computers (Windows 7 64bit). I managed to have the MSI dump data to log, file

Question about `list.insert`

2014-02-06 Thread cool-RR
Hi, I'm curious. If I append an item to a list from the left using `list.insert`, will Python always move the entire list one item to the right (which can be super-slow) or will it check first to see whether it can just allocate more memory to the left of the list and put the item there, saving

Problems compiling Python 3.4 on Ubuntu

2014-02-03 Thread cool-RR
Hi, I'm trying to install Python 3.4b3 on Ubuntu. Since compilation seems to be the only way, I'm trying that. I downloaded the source, I changed Setup.dist to have this: SSL=/usr _ssl _ssl.c \ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ -L$(SSL)/lib -lssl -l

Re: Announcing PythonTurtle

2009-08-04 Thread cool-RR
On Tue, Aug 4, 2009 at 5:45 PM, John Posner wrote: > > Certainly John- although I have not embedded the turtle module at all, >> I just wrote my own. >> > > OK, then why the statements "from turtle import *" in the modules > turtleprocess.py and turtlewidget.py? > > Tx, > John > > It's from a mo

Re: Announcing PythonTurtle

2009-08-04 Thread cool-RR
> Hi Ram, > > that's indeed a nice starting point for kids to doing turtle graphics, > although currently it seems to implement only a very small subset of > Python's turtle module's capabilities, even less than those of the old > turtle module (that shipped with Python upto 2.5). > I agree - an

Re: Announcing PythonTurtle

2009-08-04 Thread cool-RR
On Aug 4, 7:12 am, John Posner wrote: > > ... I would also venture to say a key-map > > of sorts that is available thru the help menu where one could push an > > "Up" button, or a "rotate" button, and have the proper command > > inserted in the prompt, and then have the command execute, may also >

Re: Announcing PythonTurtle

2009-08-03 Thread cool-RR
On Aug 3, 11:35 pm, r wrote: > Hello, > I wanted to announce that I have just released my little side > project, > PythonTurtle. > [snip] > > I think it looks great --haven't download the source yet-- but i > really like the screenshot. This will be more "inviting" to the new, > inexperianced user

Re: Announcing PythonTurtle

2009-08-03 Thread cool-RR
On Aug 3, 7:04 pm, "Colin J. Williams" wrote: > cool-RR wrote: > > Hello, > > > I wanted to announce that I have just released my little side project, > > PythonTurtle. > > Here is its website: > >http://pythonturtle.com > > > Its goal is to

Re: Announcing PythonTurtle

2009-08-03 Thread cool-RR
On Aug 3, 5:53 pm, André wrote: > On Aug 3, 10:18 am, cool-RR wrote: > > > Hello, > > > I wanted to announce that I have just released my little side project, > > PythonTurtle. > > Here is its website:http://pythonturtle.com > > > Its goal is to be t

Announcing PythonTurtle

2009-08-03 Thread cool-RR
Hello, I wanted to announce that I have just released my little side project, PythonTurtle. Here is its website: http://pythonturtle.com Its goal is to be the lowest-threshold way to learn (or teach) Python. You can read more about it and download it on the website. Ram. -- http://mail.python.o