Re: Best strategy for testing class and subclasses in pytest?

2015-08-23 Thread dieter
"C.D. Reimer" writes: > I'm writing a chess engine to learn about Python classes and inheritance, and > using pytest for the unit test. I've created a Piece class, which has 99% of > the functionality for a chess piece, and subclass the other pieces -- Bishop, > King, Knight, Pawn, Queen, Rook

Re: Canopy editor-Variables browser and help

2015-08-23 Thread Chris Angelico
On Mon, Aug 24, 2015 at 8:09 AM, lbertolotti via Python-list wrote: > Anyone? When you post a follow-up like this, it helps to provide some context. Fortunately for you, I have a threaded email client, but not everyone does - and not everyone was subscribed to the list when you first posted. If

Re: Canopy editor-Variables browser and help

2015-08-23 Thread breamoreboy
On Saturday, May 2, 2015 at 8:50:22 PM UTC+1, lbertolotti wrote: > Can I: > 1.Enable a variable browser in Canopy editor similar to the Spyder editor? > 2.Writing a function say log( gives me the function help, but I can't read > the whole documentation > 3.Eclipse had a auto-complete, can I enabl

Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Ben Finney
Johannes Bauer writes: > You're entirely right that this kind of personal feud and immature > mockery is inappropriate for a mailing list and you're also right that > it does create a toxic atmosphere. Since Python is the lanauge I'm > most passionate about a detrimental effect on the Python comm

Re: asyncio, coroutines, etc. and simultaneous execution

2015-08-23 Thread Akira Li
Charles Hixson writes: > If I understand correctly asyncio, coroutines, etc. (and, of course, > Threads) are not simultaneously executed, and that if one wants that > one must still use multiprocessing. But I'm not sure. The note is > still there at the start of threading, so I'm pretty sure ab

Re: Canopy editor-Variables browser and help

2015-08-23 Thread lbertolotti via Python-list
Anyone? -- https://mail.python.org/mailman/listinfo/python-list

asyncio, coroutines, etc. and simultaneous execution

2015-08-23 Thread Charles Hixson
If I understand correctly asyncio, coroutines, etc. (and, of course, Threads) are not simultaneously executed, and that if one wants that one must still use multiprocessing. But I'm not sure. The note is still there at the start of threading, so I'm pretty sure about that one. The requiremen

Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Johannes Bauer
On 23.08.2015 18:47, Michael Torrie wrote: > Since this is an ajax thing, I can entirely > understand that Firefox introduces random delays. Practically all > ajax-heavy sites I've ever used has had random slowdowns in Firefox. This would imply that random six-second delays have somehow passed t

Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Michael Torrie
On 08/23/2015 08:05 AM, Johannes Bauer wrote: > By git bisect he can find out where > he introduced the bug. Like Cecil said, this is of little help. There was no code changed from when he didn't notice the behavior until he did. >> Note that this says nothing about the location of the bug, in c

Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Cecil Westerhof
On Sunday 23 Aug 2015 17:44 CEST, MRAB wrote: >> I never blamed bottle, I was asking if it could be a problem with >> bottle. >> > The subject says otherwise. :-) Yeah, my communication skills can take some improvement. I meant: I have this problem. I think it could have to do something with bott

Re: Is this the way to go with SQLite

2015-08-23 Thread Chris Angelico
On Mon, Aug 24, 2015 at 2:17 AM, Dennis Lee Bieber wrote: > SQLite3 supports the non-standard > > INSERT OR REPLACE ... > > (or one can do INSERT OR IGNORE; the OR XXX has a number of values that are > allowed to control behavior... BUT the OR clause only applies if a UNIQU

Re: Sometimes bottle takes a lot of time

2015-08-23 Thread MRAB
On 2015-08-23 16:20, Cecil Westerhof wrote: On Sunday 23 Aug 2015 16:05 CEST, Johannes Bauer wrote: On 22.08.2015 16:15, Christian Gollwitzer wrote: Probably yes. You should take a look at the OP again and compare the time stamps. It says that in between two consecutive calls of the same prog

Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Cecil Westerhof
On Sunday 23 Aug 2015 16:05 CEST, Johannes Bauer wrote: > On 22.08.2015 16:15, Christian Gollwitzer wrote: > >> Probably yes. You should take a look at the OP again and compare >> the time stamps. It says that in between two consecutive calls of >> the same program, the request was served once in

Good resource for pythonanywhere and WSGI

2015-08-23 Thread Cecil Westerhof
I want to host my web application on pythonanywhere so that the people of Mozilla can investigate the problem it has with this application. I do not find documentation that is useful for me. Has anyone a good resource? The application I want to deploy on pythonanywhere: https://github.com/Ceci

Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Johannes Bauer
On 22.08.2015 16:15, Christian Gollwitzer wrote: > Probably yes. You should take a look at the OP again and compare the > time stamps. It says that in between two consecutive calls of the same > program, the request was served once in a second, and once with serious > delays. Despite that the serv

Re: Is this the way to go with SQLite

2015-08-23 Thread Chris Angelico
On Sun, Aug 23, 2015 at 11:18 PM, Cecil Westerhof wrote: > Also an URL is unique, so I need to check that if it is found, the > values are the same as the ones I wanted to insert. And if they aren't? Currently, all you do is print out a message and continue on; what happens if you get the same UR

Is this the way to go with SQLite

2015-08-23 Thread Cecil Westerhof
I understood that with sqlite3 in Python you can not use prepared statements. Below the way I solved this. Also an URL is unique, so I need to check that if it is found, the values are the same as the ones I wanted to insert. This is my code. ==

Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Cecil Westerhof
On Sunday 23 Aug 2015 03:05 CEST, Chris Angelico wrote: >> But in principal I have found the problem. (Not the reason.) The >> problem is Firefox. (So it is not bottle and also not AngularJS.) >> When using Chrome there is no problem. Not even when I do 15 times >> a refresh. With Firefox there is

Re: how to handle cpu cache in python ( or fastest way to call a function once)

2015-08-23 Thread Steven D'Aprano
On Sun, 23 Aug 2015 10:07 pm, Vladimir Ignatov wrote: > Hi, > >>> for i in range(100): #just to create a time interval, seems this >>> disturb cpu cache? >>> pass > > Python interpreter consumes memory quite extensively because > "everything is object". So constructions like: > > range

Re: how to handle cpu cache in python ( or fastest way to call a function once)

2015-08-23 Thread Vladimir Ignatov
Hi, >> for i in range(100): #just to create a time interval, seems this disturb >> cpu cache? >> pass Python interpreter consumes memory quite extensively because "everything is object". So constructions like: range(100): _take_ memory. Additionally it will trigger garbage collec

Re: how to handle cpu cache in python ( or fastest way to call a function once)

2015-08-23 Thread Steven D'Aprano
On Sun, 23 Aug 2015 04:10 pm, Yuzhi Xu wrote: > I find out that python's VM seems to be very unfriendly with CPU-Cache. Possibly. More comments below. > for example: > *** > import time > a = range(500) > > sum(a) > > for i in range(100): #just to c

Re: how to handle cpu cache in python ( or fastest way to call a function once)

2015-08-23 Thread Stefan Behnel
Yuzhi Xu schrieb am 23.08.2015 um 08:10: > I find out that python's VM seems to be very unfriendly with CPU-Cache. > see: > http://stackoverflow.com/questions/32163585/how-to-handle-cpu-cache-in-python-or-fastest-way-to-call-a-function-once > http://stackoverflow.com/questions/32153178/python-funct

Re: Sandboxing Python

2015-08-23 Thread Akira Li
Mark Lawrence writes: > I was always led to believe that the subject was a difficult thing to > do, but here > https://www.reddit.com/r/learnpython/comments/3huz4x/how_to_do_math_inside_raw_input/ > is a safe solution in only 23 characters, or are there any discernable > flaws in it? Related: h

Re: Qestion

2015-08-23 Thread Cameron Simpson
On 23Aug2015 09:28, Laura Creighton wrote: In a message of Sat, 22 Aug 2015 06:53:21 -, ali ranjbar writes: I have python version 2.4.3 Which version of PIL is appropriate for me and how can I add it to my systems? If you really have python 2.4.3 then you badly need a newer Python. If h

Re: Qestion

2015-08-23 Thread Laura Creighton
In a message of Sat, 22 Aug 2015 06:53:21 -, ali ranjbar writes: >hi dear friend > >I have python version 2.4.3 > >Which version of PIL is appropriate for me and how can I add it to my systems? > >Regards > >-- >https://mail.python.org/mailman/listinfo/python-list If you really have python 2.