Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread John Nagle
On 7/2/2010 9:10 PM, D'Arcy J.M. Cain wrote: On 2 Jul 2010 15:00:17 -0700 a...@pythoncraft.com (Aahz) wrote: 5. Get at least two major hosting services to put up Python 3. webfaction.com has python3.1 So does http://www.Vex.Net/ so there's your two. Not according to Vex's publishe

Re: Decorators, with optional arguments

2010-07-02 Thread Stephen Hansen
On 7/2/10 11:58 AM, Alf P. Steinbach /Usenet wrote: > > #Py3 I'm stuck on Python 2.x, as I mentioned (albeit only in a comment). That said this code does not seem to be including any Py3isms that aren't compatible. > class Thing(object): > @expose() > def test1(self, arg1): > re

Re: Decorators, with optional arguments

2010-07-02 Thread Stephen Hansen
On 7/2/10 11:55 AM, Thomas Jollans wrote: > Looks good! You may still want to use functools.update_wrapper or > functools.wraps on "wrap". Are you sure? I've been doing a little bit of experimentation and I only did the 'wraps' on that inner function, because it seemed that it was all that was nee

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread D'Arcy J.M. Cain
On 2 Jul 2010 15:00:17 -0700 a...@pythoncraft.com (Aahz) wrote: > >5. Get at least two major hosting services to put up Python 3. > > webfaction.com has python3.1 So does http://www.Vex.Net/ so there's your two. -- D'Arcy J.M. Cain | Democracy is three wolves http://www.drui

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread Terry Reedy
On 7/2/2010 3:07 PM, John Nagle wrote: That's the real issue, not parentheses on the "print" statement. Where's the business case for moving to Python 3? It's not faster. It doesn't do anything you can't do in Python 2.6. False. One cannot run code in 2.6 that depends on bugfixes in 3.1. Nor

Re: Why Is Escaping Data Considered So Magical?

2010-07-02 Thread David Cournapeau
On Mon, Jun 28, 2010 at 6:44 PM, Gregory Ewing wrote: > Carl Banks wrote: > >> Indeed, strncpy does not copy that final NUL if it's at or beyond the >> nth element.  Probably the most mind-bogglingly stupid thing about the >> standard C library, which has lots of mind-boggling stupidity. > > I don

Re: [farther OT] Re: Why Is Escaping Data Considered So Magical?

2010-07-02 Thread Rami Chowdhury
On Friday 02 July 2010 19:20:26 Lawrence D'Oliveiro wrote: > In message , Rami > Chowdhury wrote: > > On Thursday 01 July 2010 16:50:59 Lawrence D'Oliveiro wrote: > >> Nevertheless, it it at least self-consistent. To return to my original > >> > >> macro: > >> #define Descr(v) &v, sizeof v > >

Re: why python don't support "extended slice direct assignment" for lists?

2010-07-02 Thread Chris Rebert
On Fri, Jul 2, 2010 at 7:19 PM, Robert William Hanks wrote: > to say is "wrong" i think is a bit too much, its just a different type of > usage, this type of sintax is extensively used in numpy arrays (extended > slice came from numerical python), just asking why not extend the sintax to > python

Re: [farther OT] Re: Why Is Escaping Data Considered So Magical?

2010-07-02 Thread Lawrence D'Oliveiro
In message , Rami Chowdhury wrote: > On Thursday 01 July 2010 16:50:59 Lawrence D'Oliveiro wrote: > >> Nevertheless, it it at least self-consistent. To return to my original >> macro: >> >> #define Descr(v) &v, sizeof v >> >> As written, this works whatever the type of v: array, struct, wha

Re: why python don't support "extended slice direct assignment" for lists?

2010-07-02 Thread Robert William Hanks
to say is "wrong" i think is a bit too much, its just a different type of usage, this type of sintax is extensively used in numpy arrays (extended slice came from numerical python), just asking why not extend the sintax to python list. (not sure if you can use None as in the code i posted in numpy

Re: Anyone using GPG or PGP encryption/signatures in your Python apps?

2010-07-02 Thread Martin Manns
On Thu, 01 Jul 2010 14:48:47 -0400 pyt...@bdurham.com wrote: > Curious if any of you are using GPG or PGP encryption and/or > signatures in your Python apps? ... > 4. generating signatures for files that you are exchanging/posting for > download? I use pyme to create and check save file signature

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread Aahz
In article <4c2e79d3$0$1663$742ec...@news.sonic.net>, John Nagle wrote: >On 7/2/2010 3:00 PM, Aahz wrote: >> In article<4c2e38f5.10...@animats.com>, John Nagle wrote: >>> >>> 5. Get at least two major hosting services to put up Python 3. >> >> webfaction.com has python3.1 > >Any use

Re: tp_richcompare vs tp_compare

2010-07-02 Thread Aahz
In article , moerchendiser2k3 wrote: > >Do I need to implement both? Looks very redundant, isnt it? Or is it >just an extension and tp_richcompare is the better choice here? Can >anyone please make the light on here? :) Nobody else responded, so please take this non-expert advice: tp_compare is

Re: Sorting dicts inside dicts

2010-07-02 Thread MRAB
abhijeet thatte wrote: Hi, I have a huge dict structure like below: /*{'module':{'reg_dict_0':{'name':'abc','reg_addr':'2004'},'reg_dict_1':{'name':'xyz','reg_addr':'2002'},'reg_dict_2':{'name':'pqr','reg_addr':'2008'}}*/ Module dict and reg_dicts contain many elements than shown. I want to so

Re: why python don't support "extended slice direct assignment" for lists?

2010-07-02 Thread MRAB
Robert William Hanks wrote: why pure python don't support "extended slice direct assignment" for lists? today we have to write like this, >>> aList=[0,1,2,3,4,5,6,7,8,9] >>> aList [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> aList[::2]= [None]*len(aList[::2]) #or do the math by hand, what's not alwa

Crash in PyThread_acquire_lock

2010-07-02 Thread moerchendiser2k3
Hi all, I have a serious problem I want to solve. My app, where Python is embedded crashs on OSX (10.6 SL). I can reproduce the crash sometimes with a script that makes use of Python threads ( module: threading). 'thelock->locked' is for sure still locked, but I can't identify the problem. Its ju

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread Shashwat Anand
On Sat, Jul 3, 2010 at 5:27 AM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > On Fri, 02 Jul 2010 12:07:33 -0700, John Nagle wrote: > > > Where's the business case for moving to Python 3? It's not faster. It > > doesn't do anything you can't do in Python 2.6. There's no "kill

Sorting dicts inside dicts

2010-07-02 Thread abhijeet thatte
Hi, I have a huge dict structure like below: * {'module':{'reg_dict_0':{'name':'abc','reg_addr':'2004'},'reg_dict_1':{'name':'xyz','reg_addr':'2002'},'reg_dict_2':{'name':'pqr','reg_addr':'2008'}} * Module dict and reg_dicts contain many elements than shown. I want to sort this 'module' dictionar

Re: why python don't support "extended slice direct assignment" for lists?

2010-07-02 Thread Shashwat Anand
On Sat, Jul 3, 2010 at 4:54 AM, Robert William Hanks < astroultra...@gmail.com> wrote: > why pure python don't support "extended slice direct assignment" for lists? > > today we have to write like this, > > >>> aList=[0,1,2,3,4,5,6,7,8,9] > >>> aList > [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] > >>> aList[::

Re: Why defaultdict?

2010-07-02 Thread Steven D'Aprano
On Fri, 02 Jul 2010 04:11:49 +, Steven D'Aprano wrote: > I would like to better understand some of the design choices made in > collections.defaultdict. [...] Thanks to all who replied. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread Steven D'Aprano
On Fri, 02 Jul 2010 12:07:33 -0700, John Nagle wrote: > Where's the business case for moving to Python 3? It's not faster. It > doesn't do anything you can't do in Python 2.6. There's no "killer app" > for it. End of life for Python 2.x is many years away; most server Linux > distros aren't eve

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread John Nagle
On 7/2/2010 3:00 PM, Aahz wrote: In article<4c2e38f5.10...@animats.com>, John Nagle wrote: 5. Get at least two major hosting services to put up Python 3. webfaction.com has python3.1 WebFaction's big thing is that they have a really good system for installing anything the user want

Re: The real problem with Python 3 - no business case for conversion

2010-07-02 Thread Ben Finney
John Nagle writes: > Where's the business case for moving to Python 3? It's not faster. It's faster to learn, because there's less to learn. How do you know that it's not faster? That's a matter of the speed of individual Python implementations. What data do you have? > It doesn't do anythin

why python don't support "extended slice direct assignment" for lists?

2010-07-02 Thread Robert William Hanks
why pure python don't support "extended slice direct assignment" for lists? today we have to write like this, >>> aList=[0,1,2,3,4,5,6,7,8,9] >>> aList [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> aList[::2]= [None]*len(aList[::2]) #or do the math by hand, what's not always possible >>> aList [None, 1, No

Re: automate minesweeper with python

2010-07-02 Thread Emile van Sebille
On 7/2/2010 2:38 PM Jay said... OK, so how does a program read the pixel? Well, you start with a screen capture utility. I'd check is pywinauto provides that access... Emile -- http://mail.python.org/mailman/listinfo/python-list

IMAP Problems

2010-07-02 Thread Paul
Hi, I'm trying to write a simple script which displays the basic details of a person's mailbox. My problem is that it causes all the messages to be marked as read on the server, which is not what I'm after, and I also can't get the imap.sort command to work properly (currently commented out as I re

Re: Namespace problem?

2010-07-02 Thread Josh English
On Jul 1, 3:30 pm, "Rhodri James" wrote: > > If this is a version of your code that actually fails when you run it   > (rather than being another artistic interpretation of a photograph of your   > code :-), then I'd go with Matt's analysis.  This will give you a   > NameError for fws_last_col if

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread Aahz
In article <4c2e38f5.10...@animats.com>, John Nagle wrote: > >5. Get at least two major hosting services to put up Python 3. webfaction.com has python3.1 -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to do,

Re: automate minesweeper with python

2010-07-02 Thread Jay
On Jul 2, 2:13 pm, Terry Reedy wrote: > On 7/1/2010 10:18 PM, Emile van Sebille wrote: > > > > > > > On 7/1/2010 6:17 PM Terry Reedy said... > >> On 7/1/2010 6:42 PM, Emile van Sebille wrote: > >>> On 7/1/2010 2:52 PM Jay said... > pywinauto looks to be almost perfect. All I need now is to re

Re: automate minesweeper with python

2010-07-02 Thread Carl Banks
On Jul 2, 6:17 am, superpollo wrote: > Ethan Furman ha scritto: > > > > > Terry Reedy wrote: > >> On 7/1/2010 6:42 PM, Emile van Sebille wrote: > > >>> On 7/1/2010 2:52 PM Jay said... > > pywinauto looks to be almost perfect. All I need now is to read the > numbers uncovered when a mines

Re: automate minesweeper with python

2010-07-02 Thread Terry Reedy
On 7/1/2010 10:18 PM, Emile van Sebille wrote: On 7/1/2010 6:17 PM Terry Reedy said... On 7/1/2010 6:42 PM, Emile van Sebille wrote: On 7/1/2010 2:52 PM Jay said... pywinauto looks to be almost perfect. All I need now is to read the numbers uncovered when a minesweeper square is clicked on, or

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread Carl Banks
On Jul 2, 12:07 pm, John Nagle wrote: >     This has all been said before. Yes, we know. And when no one did anything about it the first dozen times it's been said, it wasn't because we didn't hear it, it was because we didn't care. We still don't care now, and won't care no matter how many tim

Re: GAE + recursion limit

2010-07-02 Thread Paul McGuire
> Does anyone have any clue what that might be? > Why the problem is on GAE (even when run locally), when command line > run works just fine (even with recursion limit decreased)? Can't explain why you see different behavior on GAE vs. local, but it is unusual for a "small" translator to flirt wit

Re: Lockless algorithms in python (Nothing to do with GIL)

2010-07-02 Thread Antoine Pitrou
On Mon, 28 Jun 2010 16:46:41 -0700 Zac Burns wrote: > In my experience it is far more expensive to allocate a lock in python then > it is the types that use them. Here are some examples: > > >>> timeit.timeit('Lock()', 'from threading import Lock') > 1.4449114807669048 > > >>> timeit.timeit('dic

Re: Decorators, with optional arguments

2010-07-02 Thread Carl Banks
On Jul 2, 10:41 am, Stephen Hansen wrote: > Okay, so! > > I actually never quite got around to learning to do deep and useful > magic with decorators. I've only ever done the most basic things with > them. Its all been a little fuzzy in my head: things like what order > decorators end up being cal

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread Thomas Jollans
On 07/02/2010 09:07 PM, John Nagle wrote: > >What I'm not seeing is a deployment plan along these lines: > >1.Identify key modules which must be converted before Python 3 > can be used in production environments. That depends VERY strongly on the environment in question. > >

The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-02 Thread John Nagle
David Cournapeau wrote: I think one point which needs to be emphasized more is what does python 3 bring to people. The" what's new in python 3 page" gives the impression that python 3 is about removing cruft. That's a very poor argument to push people to switch. That's the real issue, not p

Re: Decorators, with optional arguments

2010-07-02 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 02.07.2010 19:41: Okay, so! I actually never quite got around to learning to do deep and useful magic with decorators. I've only ever done the most basic things with them. Its all been a little fuzzy in my head: things like what order decorators end up being called in if the

Re: Decorators, with optional arguments

2010-07-02 Thread Nathan Rice
I like to think of decorators with arguments as decorator factory functions. I try and unroll them as much as possible... I have some decorators that work like so (and please note that the wraps and returns_as_output are separate so that I can mutate the behavior as needed, if you just wanted a si

Re: Decorators, with optional arguments

2010-07-02 Thread Thomas Jollans
On 07/02/2010 07:41 PM, Stephen Hansen wrote: > Okay, so! > > I actually never quite got around to learning to do deep and useful > magic with decorators. I've only ever done the most basic things with > them. Its all been a little fuzzy in my head: things like what order > decorators end up being

[ANN] Emacs For Python 0.1, collection of emacs extensions for python development

2010-07-02 Thread Gabriele Lanaro
Emacs For Python 0.1 Emacs for python (epy) is a collection of emacs extensions for python development, yet ready and configured for you. It includes also tweaks to commonly used extension to provide extra functionality and fast bug correction. There are also sane configuration that helps you ge

CFP for Surge Scalability Conference 2010

2010-07-02 Thread Jason Dixon
A quick reminder that there's one week left to submit your abstract for this year's Surge Scalability Conference. The event is taking place on Sept 30 and Oct 1, 2010 in Baltimore, MD. Surge focuses on case studies that address production failures and the re-engineering efforts that led to victor

Re: Numerics question

2010-07-02 Thread kj
Please disregard my ineptly posed question. ~K In kj writes: >I define >ninv = 1.0/n >...where n is some integer, and I want to write some function f such >that f(m * ninv) returns the smallest integer that is >= m * ninv, >where m is some other integer. And, in particular, if m is p*n

Importing package with zip-archives

2010-07-02 Thread magnus.ly...@gmail.com
I'd like to have the following structure of my Python code: I have a directory called 'mysystem'. In this directory, I have files 'comp1.zip' and 'comp2.zip' etc which are zipped archives with python packages and modules. I'd like to be able to use them like this in my code: import mysystem.comp

Numerics question

2010-07-02 Thread kj
I define ninv = 1.0/n ...where n is some integer, and I want to write some function f such that f(m * ninv) returns the smallest integer that is >= m * ninv, where m is some other integer. And, in particular, if m is p*n for some integer p, then f((p*n) * ninv) should return the integer p.

Decorators, with optional arguments

2010-07-02 Thread Stephen Hansen
Okay, so! I actually never quite got around to learning to do deep and useful magic with decorators. I've only ever done the most basic things with them. Its all been a little fuzzy in my head: things like what order decorators end up being called in if there's more then one, etc. But in my

Anyone using GPG or PGP encryption/signatures in your Python apps?

2010-07-02 Thread geremy condra
On Fri, Jul 2, 2010 at 6:15 AM, Stef Mientki wrote: >  On 02-07-2010 09:39, geremy condra wrote: >> On Thu, Jul 1, 2010 at 11:48 AM,   wrote: >>> Curious if any of you are using GPG or PGP encryption and/or signatures >>> in your Python apps? >> Yes; disclaimer: I'm the author of evpy and am curre

Re: Python 2.4.2 Installation error

2010-07-02 Thread Thomas Jollans
On 07/02/2010 05:38 PM, Dhilip S wrote: > > > Hello Everyone.. > > I'm using Ubuntu 10.04, i try to install Python 2.4.2 & Python 2.4.3 got > error message while doing make command. anybody can tell tell, How to > overcome this error Finally i got message like this ... > > 4036e000-403ad000

Re: delegation pattern via descriptor

2010-07-02 Thread Steven D'Aprano
On Fri, 02 Jul 2010 06:28:59 -0700, kedra marbun wrote: > hello, friendliest prog lang community on earth ;) > > i'm feeling that > (0) delegation pattern thru descriptor encourages dedicated delegate for > each task, if feeling: print(benefits) (1) the delegate is designed to > be blind about th

Python 2.4.2 Installation error

2010-07-02 Thread Dhilip S
Hello Everyone.. I'm using Ubuntu 10.04, i try to install Python 2.4.2 & Python 2.4.3 got error message while doing make command. anybody can tell tell, How to overcome this error Finally i got message like this ... 4036e000-403ad000 r--p 08:08 156978 /usr/lib/locale/en_IN/LC_CTYPE b

Re: drag & drop in a python GUI application

2010-07-02 Thread Michael Torrie
On 07/01/2010 08:57 AM, Alan wrote: > I know drag & drop is not possible with TK. Is this a Python Tk limitation or a Tk limitation in general? Google suggests that Tk itself supports some form of dnd. > Which widget could I use for my > python application to be able to work with drag & drop?

delegation pattern via descriptor

2010-07-02 Thread kedra marbun
hello, friendliest prog lang community on earth ;) i'm feeling that (0) delegation pattern thru descriptor encourages dedicated delegate for each task, if feeling: print(benefits) (1) the delegate is designed to be blind about the class on which the delegate is attached to isn't that the two stre

Re: automate minesweeper with python

2010-07-02 Thread superpollo
Ethan Furman ha scritto: Terry Reedy wrote: On 7/1/2010 6:42 PM, Emile van Sebille wrote: On 7/1/2010 2:52 PM Jay said... pywinauto looks to be almost perfect. All I need now is to read the numbers uncovered when a minesweeper square is clicked on, or that I just hit a mine. ... or, you c

Re: automate minesweeper with python

2010-07-02 Thread Ethan Furman
Terry Reedy wrote: On 7/1/2010 6:42 PM, Emile van Sebille wrote: On 7/1/2010 2:52 PM Jay said... pywinauto looks to be almost perfect. All I need now is to read the numbers uncovered when a minesweeper square is clicked on, or that I just hit a mine. ... or, you could always win... http:/

Re: Python v3.1.2 documentation question

2010-07-02 Thread Ethan Furman
Terry Reedy wrote: On 7/1/2010 6:42 PM, Ethan Furman wrote: Hmmm Well, as this is my first ever bug post (yay! ;) Great! > I *think* this is what you want: http://bugs.python.org/issue9121 I believe Benjamin meant that it was already fixed in http://docs.python.org/dev/py3k/ whic

Re: Ignorance and Google Groups (again)

2010-07-02 Thread Dotan Cohen
On 2 July 2010 05:10, D'Arcy J.M. Cain wrote: > On Thu, 1 Jul 2010 21:34:15 +0300 > Dotan Cohen wrote: >> I'm one of them. Gmail is great for mailing lists, though I would >> never use it as a personal email client. But I'm more of a lurker than >> a poster on this list, so D'Arcy won't miss me a

Re: escape character / csv module

2010-07-02 Thread John Machin
On Jul 2, 6:04 am, MRAB wrote: > The csv module imports from _csv, which suggests to me that there's code > written in C which thinks that the "\x00" is a NUL terminator, so it's a > bug, although it's very unusual to want to write characters like "\x00" > to a CSV file, and I wouldn't be surpri

Re: Pool Module: iterator does not yield consistently with different chunksizes

2010-07-02 Thread Dave Angel
syockit wrote: I've been playing around with custom iterators to map into Pool. When I run the code below: def arif(arr): return arr def permutate(n): k = 0 a = list(range(6)) while k While I didn't actually try to follow all your code, I suspect your problem is that when you

Re: Pool Module: iterator does not yield consistently with different chunksizes

2010-07-02 Thread Peter Otten
syockit wrote: > I've been playing around with custom iterators to map into Pool. When > I run the code below: > > def arif(arr): > return arr > > def permutate(n): > k = 0 > a = list(range(6)) > while k for i in range(6): > a.insert(0, a.pop(5)+6) > #

Re: Python as a scripting language. Alternative to bash script?

2010-07-02 Thread Jerry Rocteur
* Dave Pawson [2010-07-02 08:22]: > I'm the OP btw. > > On 1 July 2010 18:10, Dennis Lee Bieber wrote: > > >> I think that Python "could" be a alternative to bash and have some > >> advantages, but it's a long way off from being fully implemented. > > Take a look at Python for Unix and Linux S

Re: Anyone using GPG or PGP encryption/signatures in your Python apps?

2010-07-02 Thread Stef Mientki
On 02-07-2010 09:39, geremy condra wrote: > On Thu, Jul 1, 2010 at 11:48 AM, wrote: >> Curious if any of you are using GPG or PGP encryption and/or signatures >> in your Python apps? > Yes; disclaimer: I'm the author of evpy and am currently working on a > openssl wrapper proposed for inclusion

Re: Python dynamic attribute creation

2010-07-02 Thread Bruno Desthuilliers
WANG Cong a écrit : On 06/30/10 01:25, Ethan Furman wrote: But if so why setattr() still exists? What is it for if we can do the same thing via assignments? Also, in order to be perfect, Python should accept to add dynamic attributes dynamically, something like PEP 363. That doesn't happen. S

Re: Python dynamic attribute creation

2010-07-02 Thread Bruno Desthuilliers
WANG Cong a écrit : On 07/01/10 23:19, Stephen Hansen wrote: As long as setattr() exists in Python, that will be not so ordinary. :) setattr is perfectly ordinary. If you think setattr() is as ordinary as a trivial assignment, setattr IS a trivial assignment. However, I think setattr(

Re: Python dynamic attribute creation

2010-07-02 Thread Gregory Ewing
WANG Cong wrote: However, I think setattr() is a builtin function, using it exposes the *magic* of metaprogramming (or class-programming, if more correct) at a first glance. But, in Python, creating instance variables is *not* class-programming. It doesn't touch the class at all. In many OO l

Re: Why defaultdict?

2010-07-02 Thread Thomas Jollans
On 07/02/2010 11:26 AM, Chris Rebert wrote: > On Fri, Jul 2, 2010 at 2:20 AM, Thomas Jollans wrote: >> On 07/02/2010 06:11 AM, Steven D'Aprano wrote: >>> I would like to better understand some of the design choices made in >>> collections.defaultdict. > >>> Second, why is the factory function not

Re: Why defaultdict?

2010-07-02 Thread Chris Rebert
On Fri, Jul 2, 2010 at 2:20 AM, Thomas Jollans wrote: > On 07/02/2010 06:11 AM, Steven D'Aprano wrote: >> I would like to better understand some of the design choices made in >> collections.defaultdict. >> Second, why is the factory function not called with key? There are three >> obvious kinds o

Re: Why defaultdict?

2010-07-02 Thread Thomas Jollans
On 07/02/2010 06:11 AM, Steven D'Aprano wrote: > I would like to better understand some of the design choices made in > collections.defaultdict. > > Firstly, to initialise a defaultdict, you do this: > > from collections import defaultdict > d = defaultdict(callable, *args) > > which sets an at

Re: GAE + recursion limit

2010-07-02 Thread David Cournapeau
On Fri, Jul 2, 2010 at 5:06 PM, Maciej wrote: > Does anyone have any clue what that might be? > Why the problem is on GAE (even when run locally), when command line > run works just fine (even with recursion limit decreased)? > Thanks in advance for any help. Most likely google runs a customized

Re: Bento 0.0.3 (ex-toydist), a pythonic packaging solution

2010-07-02 Thread David Cournapeau
On Fri, Jul 2, 2010 at 4:46 PM, Tim Golden wrote: > > Looks very interesting. Just one thing (which might just be me): > the front page looks very stylish and is quite a nice summary. > But I actually *missed* the (grey on grey) [Take me to Bento documentation] > button, which is way below the fo

Re: Python dynamic attribute creation

2010-07-02 Thread Gregory Ewing
WANG Cong wrote: When I talked about OOP, it is general OOP, not related with > any concrete programming languages. There isn't really any such thing, though. There is no universally agreed set of features that a language must have in order to be considered OOP. Arguments of the form "Language

Re: Python dynamic attribute creation

2010-07-02 Thread Gregory Ewing
WANG Cong wrote: Yeah, my point is why setattr() for dynamic attributes while assignments for static attributes? I think there may be a misunderstanding here. You seem to be thinking of "dynamic attribute" vs. "static attribute" as the distinction between creating a new attribute and modifying

Pool Module: iterator does not yield consistently with different chunksizes

2010-07-02 Thread syockit
I've been playing around with custom iterators to map into Pool. When I run the code below: def arif(arr): return arr def permutate(n): k = 0 a = list(range(6)) while khttp://mail.python.org/mailman/listinfo/python-list

Re: Python dynamic attribute creation

2010-07-02 Thread Gregory Ewing
WANG Cong wrote: If you think setattr() is as ordinary as a trivial assignment, I will argue with you, this is personal taste. To my way of thinking, getattr() and setattr() are the fundamental way of accessing attributes in Python. The dot notation is just syntactic sugar for the overwhelming

Re: Packaging question

2010-07-02 Thread Peter Otten
snorble wrote: > My question is, why do the modules bar and foo show up in mypack's > dir()? I intend for Foo (the class foo.Foo) and Bar (the class > bar.Bar) to be there, but was not sure about the modules foo and bar. > $ ls mypack/*.py > bar.py > foo.py > __init__.py > > $ cat mypack/__init_

GAE + recursion limit

2010-07-02 Thread Maciej
Hi, I'm writing a small translator using pyparsing library v1.5.2 (http://pyparsing.wikispaces.com/) and I'm using it both from command line and on Google App Engine. Recently I checked one of my samples which runs perfect from CLI against GAE and it throws me "RuntimeError 'maximum recursion depth

Re: Bento 0.0.3 (ex-toydist), a pythonic packaging solution

2010-07-02 Thread Tim Golden
On 02/07/2010 03:38, David wrote: I am pleased to announce the release 0.0.3 for Bento, the pythonic packaging solution. Bento aims at being an alternative to distutils/setuptools/distribute, based on a static metadata file format. Existing packages can be converted from setup.py to bento format

Re: Anyone using GPG or PGP encryption/signatures in your Python apps?

2010-07-02 Thread geremy condra
On Thu, Jul 1, 2010 at 11:48 AM, wrote: > Curious if any of you are using GPG or PGP encryption and/or signatures > in your Python apps? Yes; disclaimer: I'm the author of evpy and am currently working on a openssl wrapper proposed for inclusion in the stdlib. > In particular are you: > > 1. cl

Re: automate minesweeper with python

2010-07-02 Thread Mark Young
Just tested it in XP, it works. -- http://mail.python.org/mailman/listinfo/python-list

drag & drop in a python GUI application

2010-07-02 Thread Alan
Hello there, I know drag & drop is not possible with TK. Which widget could I use for my python application to be able to work with drag & drop? Thanks, Alan -- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Court Road, C