Re: A use-case for for...else with no break

2017-11-02 Thread Alberto Berti
> "Wolfgang" == Wolfgang Maier > writes: Wolfgang> Try running it interactively and you'll see, Wolfgang> wolfgang I've tried but my muscolar memory failed me... i've issued a C-c C-c that usually would have sent the region of text to the interpreter session (when done from python

Re: A use-case for for...else with no break

2017-11-02 Thread Alberto Berti
> "Steve" == Steve D'Aprano writes: py> for x in "abcdefgh": Steve> ... print(x, end='') Steve> ... py> efghpy> Steve> "For ... else" to the rescue! py> for char in "abcdefgh": Steve> ... print(char, end='') Steve> ... else: Steve> ... print(

Re: Cooperative class tree filtering

2017-10-31 Thread Alberto Berti
Thanks Ian, >>>>> "Ian" == Ian Kelly writes: Ian> On Thu, Oct 12, 2017 at 5:07 PM, Alberto Berti wrote: Ian> My initial reaction is: is this really worth it? This seems like an Ian> awful lot of code and added complexity in order to do away w

Re: Invoking return through a function?

2017-10-31 Thread Alberto Berti
> "Lele" == Lele Gaifax writes: Lele> r...@zedat.fu-berlin.de (Stefan Ram) writes: Stefan> There are many macro processors available, like the C macro Stefan> preprocessor, gpp, M4, or funnelweb. You can always use them Stefan> for your Python source (which, in this case, isn'

Re: Cooperative class tree filtering

2017-10-12 Thread Alberto Berti
Sorry, i've made a mistake in the second C body, it's written like: >>>>> "me" == Alberto Berti writes: me> I've tried some variants of the 'super()' trick, that sometimes seems to me> change behavior if it's written like th

Cooperative class tree filtering

2017-10-12 Thread Alberto Berti
Hello, suppose you have you have three classes A, B, C where C is a subclass of B and B of A. They provide a method with signature `filter(element)`. It is called by an external function that collects the elements and then to an instance of the classes A, B and C is given a chance to filter these

Re: Question about asyncio and blocking operations

2016-01-26 Thread Alberto Berti
>>>>> "Alberto" == Alberto Berti writes: Alberto> async external_coro(): # this is the calling context, which is a coro Alberto> async with transction.begin(): Alberto> o = MyObject Alberto> # ma

Re: Question about asyncio and blocking operations

2016-01-26 Thread Alberto Berti
> "Frank" == Frank Millman writes: Frank> Now I have another problem. I have some classes which retrieve some Frank> data from the database during their __init__() method. I find that it Frank> is not allowed to call a coroutine from __init__(), and it is not Frank> allowed to

Re: securing a python execution environment...

2007-11-19 Thread Alberto Berti
maybe using import hooks? http://www.python.org/dev/peps/pep-0302/ -- http://mail.python.org/mailman/listinfo/python-list

Re: why there is no pythonscript insine web browsers?

2007-11-15 Thread Alberto Berti
> "Piet" == Piet van Oostrum <[EMAIL PROTECTED]> writes: Piet> CGI is server-side. The OP was asking for client-side Piet> embedding of Python. FireFox 3 aka "Gran Paradiso" can be compiled to have python scripting but for security reasons it can be used only on crome:// urls, which l

Re: Populating a dictionary, fast

2007-11-11 Thread Alberto Berti
> "Michael" == Michael Bacarella <[EMAIL PROTECTED]> writes: >> > This would seem to implicate the line id2name[id] = name as >> being Michael> excruciatingly slow. >> >> As others have pointed out there is no way that this takes 45 >> minutes.Must be something with y

Re: Populating a dictionary, fast

2007-11-11 Thread Alberto Berti
> "Steven" == Steven D'Aprano <[EMAIL PROTECTED]> writes: Steven> $ time ./slurp_dict.py Starting at Sun Nov 11 14:26:51 Steven> 2007 Line 0 Line 100 Line 200 Line 300 Line Steven> 400 Line 500 Line 600 Line 700 Line Steven> 800 Items in dict: 81

Re: Writing GTK UI for Python apps in XUL

2007-11-02 Thread Alberto Berti
> "Devraj" == Devraj <[EMAIL PROTECTED]> writes: Devraj> Hi everyone, Is it possible to write UI code in XUL for a Devraj> GTK Python application? I found NuFox, which does the Devraj> reverse (lets me write Python to generate XUL) i wrote such a system as a proof of concept, it'

Re: XUL Parser?

2004-12-02 Thread Alberto Berti
Hi, I'm slowly developing a "thin client environment" that will use xul, or a part of it as gui language, all done in python and that uses python instead of js as scripting language and "event binding". It builds the gui using pyGTK. Who is interested can find more info here: http://artiemestieri