Re: Guide to: Learning Python Decorators

2012-02-12 Thread Jack Diederich
just google "jack diederich decorators" it costs nothing and you get a free pycon talk out of it. -Jack -- http://mail.python.org/mailman/listinfo/python-list

Re: OAuth 2.0 implementation

2012-03-26 Thread Jack Diederich
On Tue, Mar 27, 2012 at 12:24 AM, Ben Finney wrote: > Roy Smith writes: > >> In article <878vimhfdp@benfinney.id.au>, >>  Ben Finney wrote: >> > So, if I want to be free to choose an identity provider I trust, and >> > it's not Facebook or Google or Twitter or other privacy-hostile >> > serv

Re: Generator Frustration

2011-06-04 Thread Jack Diederich
On Sat, Jun 4, 2011 at 9:43 PM, Gregory Ewing wrote: > Steven D'Aprano wrote: > >> A nice piece of syntax that has been proposed for Python is "yield from", >> which will do the same thing, but you can't use that yet. You can also patch the library to always return lists instead of generators. d

Re: with statement and context managers

2011-08-02 Thread Jack Diederich
On Tue, Aug 2, 2011 at 10:15 PM, Steven D'Aprano wrote: > I'm not greatly experienced with context managers and the with statement, so > I would like to check my logic. > > Somebody (doesn't matter who, or where) stated that they frequently use this > idiom: > > spam = MyContextManager(*args) > fo

Re: Problems with read_eager and Telnet

2011-02-28 Thread Jack Diederich
On Mon, Feb 28, 2011 at 10:54 AM, Robi wrote: > Hi everybody, >  I'm totally new to Python but well motivated :-) > > I'm fooling around with Python in order to interface with FlightGear > using a telnet connection. > > I can do what I had in mind (send some commands and read output from > Flightg

Re: Problems with read_eager and Telnet

2011-02-28 Thread Jack Diederich
On Mon, Feb 28, 2011 at 11:50 AM, Robi wrote: >> Telnet sends two kinds of data over the same channel (a simple TCP >> stream).  It sends the bytes you actually see in your terminal and it >> sends control commands that do things like turn echo on/off and >> negotiate what terminal type to use.  E

Re: Problems with read_eager and Telnet

2011-02-28 Thread Jack Diederich
On Mon, Feb 28, 2011 at 12:13 PM, Roberto Inzerillo wrote: > Yes. read_eager() will never actually read from the socket, if it has >> >> any data it has already read & processed it will return those.  If you >> call it enough times it will just start returning empty strings >> because it never ask

Re: Best practices for dynamically loading plugins at startup

2005-09-26 Thread Jack Diederich
On Sun, Sep 25, 2005 at 11:24:04PM +0200, Christoph Haas wrote: > Dear coders... > > I'm working on an application that is supposed to support "plugins". > The idea is to use the plugins as packages like this: > > Plugins/ > __init__.py > Plugin1.py > Plugin2.py > Plugin3.py > > When the

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-07 Thread Jack Diederich
On Fri, Oct 07, 2005 at 09:14:51PM -, Grant Edwards wrote: > On 2005-10-07, Terry Hancock <[EMAIL PROTECTED]> wrote: > > > Of course, just to keep y'all on your toes, we Texans have not only > > construed "their" to singular, but also "you", and added a new > > plural "y'all". > > AFAICT, in

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-07 Thread Jack Diederich
On Fri, Oct 07, 2005 at 10:28:18PM -, Grant Edwards wrote: > On 2005-10-07, Jack Diederich <[EMAIL PROTECTED]> wrote: > > > > It is a bit odd that You'uns, yins, and yous are confined to Pennsylvania > > and very distinct east-west regions inside PA at that

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-16 Thread Jack Diederich
On Tue, Nov 15, 2005 at 10:10:42PM -0800, Neal Norwitz wrote: > Alex Martelli wrote: > > matt <[EMAIL PROTECTED]> wrote: > > > > > Perhaps you could extend Valgrind (http://www.valgrind.org) so it works > > > with python C extensions? (x86 only) > > > > Alas, if it's x86 only I won't even look in

Re: Looking for small, impressive 3D-related Python script

2005-11-28 Thread Jack Diederich
On Mon, Nov 28, 2005 at 04:44:56PM -0600, Kenneth McDonald wrote: > I'm not trying to persuade my company to offer Python as a scripting > language for their product, but I am trying to give them examples of > things that Python can do easily that cannot be done easily with > their current pr

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-07 Thread Jack Diederich
On Fri, Jan 07, 2005 at 01:35:46PM -0800, aurora wrote: > Hello! > > Just gone though an article via Slashdot titled "The Free Lunch Is Over: A > Fundamental Turn Toward Concurrency in Software" > [http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that the > continous CPU perfo

Re: How to list the global functions from a C program

2005-01-14 Thread Jack Diederich
On Fri, Jan 14, 2005 at 04:01:13PM +0100, Francesco Montorsi wrote: > PyObject *list = PyObject_Dir(m_pGlobals); > if (!list || PyList_Check(list) == FALSE) > return; > > for (int i=0,max=PyList_Size(list); i > PyObject *elem = PyList_GetItem(list, i); > if (PyCallable_Check(elem) !=

Re: RuntimeError: dictionary changed size during iteration

2005-01-19 Thread Jack Diederich
On Wed, Jan 19, 2005 at 11:45:15PM +0300, Roman Suzi wrote: > > I think, the behaviour below is misfeature: > > >>> [e for e in vars()] > Traceback (most recent call last): > File "", line 1, in ? > RuntimeError: dictionary changed size during iteration > >>> e = None > >>> [e for e in vars()]

Re: Zen of Python

2005-01-19 Thread Jack Diederich
On Wed, Jan 19, 2005 at 09:28:13PM -0500, Peter Hansen wrote: > Jeff Shannon wrote: > >Timothy Fitz wrote: > >>Which I agree with, and which makes sense. However your "gist" is a > >>different meaning. It's not that "Flat is better than nested" it's > >>that "Too flat is bad and too flat is nested

Re: building extensions: ming & python mathlink for win32

2005-01-20 Thread Jack Diederich
On Thu, Jan 20, 2005 at 08:38:35PM +0100, Jelle Feringa // EZCT / Paris wrote: > Have been trying to build python extensions from the C libs ming & mathlink. > Same thing goes for Ming (c lib for compiling flas .swf files), such a pity > no disutils script is included in this very powerful library!

Re: Another scripting language implemented into Python itself?

2005-01-24 Thread Jack Diederich
On Mon, Jan 24, 2005 at 09:17:24PM -0500, Roy Smith wrote: > Rocco Moretti <[EMAIL PROTECTED]> wrote: > > The OP doesn't mention his application, but there is something to be > > said about domain specific scripting languages. A well designed > > domain-specific scripting language(*) with the app

Re: limited python virtual machine (WAS: Another scripting language implemented into Python itself?)

2005-01-26 Thread Jack Diederich
On Wed, Jan 26, 2005 at 05:18:59PM +0100, Alexander Schremmer wrote: > On Tue, 25 Jan 2005 22:08:01 +0100, I wrote: > > sys.safecall(func, maxcycles=1000) > > could enter the safe mode and call the func. > > This might be even enhanced like this: > > >>> import sys > >>> sys.safecall(func,

Re: limited python virtual machine (WAS: Another scripting language implemented into Python itself?)

2005-01-26 Thread Jack Diederich
On Wed, Jan 26, 2005 at 10:23:03AM -0700, Steven Bethard wrote: > Jack Diederich wrote: > >Yes, this comes up every couple months and there is only one answer: > >This is the job of the OS. > >Java largely succeeds at doing sandboxy things because it was written that > >

Re: limited python virtual machine (WAS: Another scripting language implemented into Python itself?)

2005-01-26 Thread Jack Diederich
On Wed, Jan 26, 2005 at 10:39:18AM -0800, aurora wrote: > >On Wed, Jan 26, 2005 at 05:18:59PM +0100, Alexander Schremmer wrote: > >>On Tue, 25 Jan 2005 22:08:01 +0100, I wrote: > >> > >> sys.safecall(func, maxcycles=1000) > >>> could enter the safe mode and call the func. > >> > >>This might be

Re: limited python virtual machine

2005-01-30 Thread Jack Diederich
On Sun, Jan 30, 2005 at 11:59:39AM +1000, Nick Coghlan wrote: > Alex Martelli wrote: > >It didn't seem to me that Steven's question was so restricted; and since > >he thanked me for my answer (which of course is probably inapplicable to > >some custom interpreter that's not written yet) it appears

Re: OT: why are LAMP sites slow?

2005-02-04 Thread Jack Diederich
On Thu, Feb 03, 2005 at 10:09:49PM -0800, Paul Rubin wrote: > aurora <[EMAIL PROTECTED]> writes: > > I'm lost. So what do you compares against when you said LAMP is slow? > > What is the reference point? Is it just a general observation that > > slashdot is slower than we like it to be? [reordere

Re: "Collapsing" a list into a list of changes

2005-02-04 Thread Jack Diederich
On Fri, Feb 04, 2005 at 12:43:37PM -0500, Alan McIntyre wrote: > Hi all, > > I have a list of items that has contiguous repetitions of values, but > the number and location of the repetitions is not important, so I just > need to strip them out. For example, if my original list is > [0,0,1,1,1

Re: Persistence design [was: RE: OT: why are LAMP sites slow?]

2005-02-04 Thread Jack Diederich
On Fri, Feb 04, 2005 at 10:31:19AM -0800, Robert Brewer wrote: > Jack Diederich wrote: > > *ding*ding*ding* The biggest mistake I've made most > > frequently is using > > a database in applications. YAGNI. Using a database at all has it's > > own overhe

Re: Persistence design [was: RE: OT: why are LAMP sites slow?]

2005-02-04 Thread Jack Diederich
On Fri, Feb 04, 2005 at 09:09:46PM -0200, Carlos Ribeiro wrote: > On Fri, 4 Feb 2005 17:46:44 -0500, Jack Diederich <[EMAIL PROTECTED]> wrote: > > On Fri, Feb 04, 2005 at 10:31:19AM -0800, Robert Brewer wrote: > > > Jack Diederich wrote: > > > > If there

Re: "Collapsing" a list into a list of changes

2005-02-05 Thread Jack Diederich
On Sat, Feb 05, 2005 at 02:31:08PM +1000, Nick Coghlan wrote: > Jack Diederich wrote: > >Since this is 2.4 you could also return a generator expression. > > > > > >>>>def iter_collapse(myList): > > > >... return (x[0] for (x) in

Re: A World Beyond Capitalism 2005, An Annual International Multiracial Alliance Building Peace Conference Is Accepting Proposals...

2005-06-21 Thread Jack Diederich
On Tue, Jun 21, 2005 at 11:30:19PM -0400, Jenta wrote: > A World Beyond Capitalism 2005, An Annual International Multiracial > Alliance Building Peace Conference Is Accepting Proposals... > This must be a joke (and please please be a joke like the recent viral website competition[1] that featured

Re: Efficiency of using long integers to hold bitmaps

2005-07-12 Thread Jack Diederich
On Wed, Jul 13, 2005 at 03:24:48AM +1000, Jeff Melvaine wrote: > Bengt, > > Thanks for your informative reply, further comments interleaved. > > "Bengt Richter" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On Mon, 11 Jul 2005 02:37:21 +1000, "Jeff Melvaine" > > <[EMAIL PROT

Re: all possible combinations

2005-07-13 Thread Jack Diederich
On Wed, Jul 13, 2005 at 05:07:33PM +0100, Duncan Smith wrote: > rbt wrote: > > On Wed, 2005-07-13 at 11:09 -0400, rbt wrote: > > > >>On Wed, 2005-07-13 at 10:21 -0400, rbt wrote: > >> > >>>Say I have a list that has 3 letters in it: > >>> > >>>['a', 'b', 'c'] > >>> > >>>I want to print all the pos

Re: Sr. Compiler Engineering Opportunity

2005-07-28 Thread Jack Diederich
Great, Transmeta is hiring. What does this have to do with python? Hmm, Mutliprocessor or Multicore Transmeta chips? Let the rumor mongering begin. On Thu, Jul 28, 2005 at 12:40:13AM -0700, Nathan Sanders wrote: > Hello- > > I'm hoping to network with you and find out if you know anyone who > y

Re: Module Extension C/CPI Question

2005-08-10 Thread Jack Diederich
On Tue, Aug 09, 2005 at 09:15:17PM -0400, Jeremy Moles wrote: > When using the C API and writing extension modules, how do you normally > pass a structure up into the python module? For instance, if I have a > structure: > > typedef struct Foo { > int x; > int y; > int z; >

Re: Permutation Generator

2005-08-14 Thread Jack Diederich
On Fri, Aug 12, 2005 at 03:48:38PM -0400, Michael J. Fromberger wrote: > In article <[EMAIL PROTECTED]>, > Talin <[EMAIL PROTECTED]> wrote: > > > I'm sure I am not the first person to do this, but I wanted to share > > this: a generator which returns all permutations of a list: > > You're right

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 04:44:24PM +, Mark Dickinson wrote: > I have a simple 192-line Python script that begins with the line: > > dummy0 = 47 > > The script runs in less than 2.5 seconds. The variable dummy0 is never > referenced again, directly or indirectly, by the rest of the script. >

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 01:35:04PM -0400, Bill Mill wrote: > On 8/25/05, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > Mark Dickinson wrote: > > > > > Questions: > > > > > > (1) Can anyone else reproduce this behaviour, or is it just some quirk > > > of my setup? > > > (2) Any possible expla

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 01:55:48PM -0400, Bill Mill wrote: > Bill Mill wrote: > > > > Pentium M 1.8 GHz Windows 2k. Here's the top of the profile results > > for fast and slow on my machine (these won't look decent except in a > > fixed-width font): > > > > > > > Interestingly, the test.py:36 li

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 09:23:09PM +0300, Stelios Xanthakis wrote: > The explanation is this: hash > and comparison of objects depends on the state of the memory > allocator. A sample case is this: > > class A: pass > dummy0=47 # comment this to get a different result for min >

Re: [perl-python] combinatorics fun

2005-02-10 Thread Jack Diederich
On Thu, Feb 10, 2005 at 02:51:24PM -0800, Xah Lee wrote: > a year ago i wrote this perl program as part of a larger program. > > as a exercise of fun, let's do a python version. I'll post my version > later today. from probstat import Combination There is something deeply wrong about plugging yo

Re: Kill GIL (was Re: multi threading in multi processor (computer))

2005-02-12 Thread Jack Diederich
On Sat, Feb 12, 2005 at 07:13:17PM -0500, Aahz wrote: > In article <[EMAIL PROTECTED]>, > Paul Rubin wrote: > > > >The day is coming when even cheap computers have multiple cpu's. > >See hyperthreading and the coming multi-core P4's, and the finally > >announced Cell pro

Re: Inheritance error in python 2.3.4???

2005-02-14 Thread Jack Diederich
On Tue, Feb 15, 2005 at 10:56:23AM +1100, Delaney, Timothy C (Timothy) wrote: > [EMAIL PROTECTED] wrote: > > > I guess I could just use one underscore but that means it is > > easier for other people to get at my implementation details (which, > > coming from a C++ background really bothers me

Re: Can __new__ prevent __init__ from being called?

2005-02-15 Thread Jack Diederich
On Tue, Feb 15, 2005 at 10:30:21PM +0100, Felix Wiemann wrote: > Sometimes (but not always) the __new__ method of one of my classes > returns an *existing* instance of the class. However, when it does > that, the __init__ method of the existing instance is called > nonetheless, so that the instanc

Re: "perl -p -i -e" trick in Python?

2005-02-15 Thread Jack Diederich
On Wed, Feb 16, 2005 at 04:38:03PM +1000, Stephen Thorne wrote: > On Wed, 16 Feb 2005 15:18:57 +0900, Wonjae Lee <[EMAIL PROTECTED]> wrote: > > I read the comment of > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277753. > > (Title : Find and replace string in all files in a directory)

Re: Help with research

2005-02-18 Thread Jack Diederich
On Thu, Feb 17, 2005 at 07:09:44PM -0500, Jeremy Bowers wrote: > On Thu, 17 Feb 2005 15:51:47 -0800, elena wrote: > > I can go to my friends, however it occurred to me that it might be > > better to post in a newsgroup and get a larger, more diverse, and > > random sample. > > Larger, yes, more d

Re: iterative lambda construction

2005-02-21 Thread Jack Diederich
On Mon, Feb 21, 2005 at 01:14:00PM -0800, Paul Rubin wrote: > "markscottwright" <[EMAIL PROTECTED]> writes: > > But when I try to do it iteratively, it just hangs when I try to > > evaluate the results (for count > 1): > > > > def repeated2(f, count): > > newfun = f > > for i in range(coun

Re: Python Online Programming Contest

2005-02-24 Thread Jack Diederich
On Thu, Feb 24, 2005 at 06:18:09PM -0800, Varun wrote: > Hi, > It is open for anyone across the world. All times are local ( GMT > +5:30). The contest will be on Feb 27 (this sunday) and i will ensure > that the times are clearly specified. How long is the contest? ICFP is three days (first 24 ho

Re: naming convention for scalars, lists, dictionaries ...

2005-02-28 Thread Jack Diederich
On Mon, Feb 28, 2005 at 11:32:22AM -0700, Steven Bethard wrote: > [EMAIL PROTECTED] wrote: > >Since Python does not have declarations, I wonder if people think it is > >good to name function arguments according to the type of data structure > >expected, with names like "xlist" or "xdict". > > In g

Re: naming convention for scalars, lists, dictionaries ...

2005-02-28 Thread Jack Diederich
On Mon, Feb 28, 2005 at 04:02:37PM -0500, Benji York wrote: > Jack Diederich wrote: > >Ditto for me, plural implies list and singular implies instance, > >for (contact) in contacts: > > # do something with contact > > May I ask why you place the parenthesis in the

Re: naming convention for scalars, lists, dictionaries ...

2005-02-28 Thread Jack Diederich
On Mon, Feb 28, 2005 at 09:41:37PM +0100, Just wrote: > In article <[EMAIL PROTECTED]>, > Jack Diederich <[EMAIL PROTECTED]> wrote: > > > On Mon, Feb 28, 2005 at 04:02:37PM -0500, Benji York wrote: > > > Jack Diederich wrote: > > > >Ditto for me, p

Re: Wishlist item: itertools.flatten

2005-03-11 Thread Jack Diederich
On Sat, Mar 12, 2005 at 12:55:38AM +0200, Christos TZOTZIOY Georgiou wrote: > On 12 Mar 2005 00:44:39 +0200, rumours say that Ville Vainio > <[EMAIL PROTECTED]> might have written: > > >Christos> This is just a personal opinion, but I detest restraints > >Christos> on library (itertools mo

Re: ming for python

2004-12-08 Thread Jack Diederich
On Tue, Dec 07, 2004 at 07:55:09PM +0100, titouille wrote: > Hello everybody !! > > anyone has try to build ming0.3beta1 for python 2.3.3 under windows ?? > > Since three days, I try to build it with mingw32, and finally, I am > stopped with C declarations error in src/actioncompiler/swf4compile

Re: Pre-PEP: Dictionary accumulator methods

2005-03-28 Thread Jack Diederich
On Sun, Mar 27, 2005 at 02:20:33PM -0700, Steven Bethard wrote: > Michele Simionato wrote: > >I am surprised nobody suggested we put those two methods into a > >separate module (say dictutils or even UserDict) as functions: > > > >from dictutils import tally, listappend > > > >tally(mydict, key) >

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-28 Thread Jack Diederich
On Mon, Mar 28, 2005 at 10:28:29AM -0700, Steven Bethard wrote: > Jack Diederich wrote: > > > > itertools to iter transition, huh? I slipped that one in, I mentioned > > it to Raymond at PyCon and he didn't flinch. It would be nice not to > > have to sprinkle

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Jack Diederich
On Tue, Mar 29, 2005 at 12:38:42PM +0300, Ville Vainio wrote: > > "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes: > > Raymond> If the experience works out, then all you're left with is > Raymond> the trivial matter of convincing Guido that function > Raymond> attributes

Re: string goes away

2005-03-31 Thread Jack Diederich
On Thu, Mar 31, 2005 at 08:32:20PM -0800, Andreas Beyer wrote: > Hi: > > If I am getting the docs etc. correctly, the string-module is depricated > and is supposed to be removed with the release of Python 3.0. > I still use the module a lot and there are situations in which I don't > know what t

Re: Equivalent string.find method for a list of strings

2005-04-08 Thread Jack Diederich
On Fri, Apr 08, 2005 at 02:17:32PM -0400, jeremit0 wrote: > I have read a text file using the command > > lines = myfile.readlines() > > and now I want to seach those lines for a particular string. I was > hoping there was a way to "find" that string in a similar way as > searching simply a si

Re: Puzzling OO design problem

2005-04-08 Thread Jack Diederich
On Fri, Apr 08, 2005 at 04:42:52PM -0700, George Sakkis wrote: > I'm looking for a design to a problem I came across, which goes like > this (no, it's not homework): > > 1. There is a (single inheritance) hierarchy of domain classes, say > A<-B<-..<-Z (arrows point to the parent in the inheritance

Re: Puzzling OO design problem

2005-04-08 Thread Jack Diederich
On Fri, Apr 08, 2005 at 06:40:54PM -0700, George Sakkis wrote: > > Err, you might want to explain what these things do instead of an > > abstract description of how you are doing it. It looks like you are > > using inheritance in the normal way _and_ you are using it to handle > > versioning of so

Re: Python extension performance

2005-04-08 Thread Jack Diederich
On Fri, Apr 08, 2005 at 10:14:52PM -0400, David Jones wrote: > I am trying to hunt down the difference in performance between some raw > C++ code and calling the C++ code from Python. My goal is to use Python > to control a bunch of number crunching code, and I need to show that > this will not

Re: some sort of permutations...

2005-04-12 Thread Jack Diederich
On Tue, Apr 12, 2005 at 08:41:15AM -0400, Bill Mill wrote: > On Apr 12, 2005 2:37 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > "Bernard A." wrote: > > > > > i'm looking for a way to have all possible length fixed n-uples from a > > > list, i think generators can help, but was not able to do it

Re: Private class?

2005-04-21 Thread Jack Diederich
On Thu, Apr 21, 2005 at 06:13:02AM -0700, codecraig wrote: > Hi, > First, I come from a Java background. > > Ok, so I have this idea that I want to create an EventBus...basically > a central class where objects can register themselves as listeners for > different events. This central class al

Re: Using Ming on Windows

2005-04-23 Thread Jack Diederich
On Sat, Apr 23, 2005 at 05:13:29PM -0300, Andr? Roberge wrote: > I tried to install Ming > (http://sourceforge.net/projects/ming/) > on Windows to use with Python *but* > I can't [/don't know how to] use "make" to install it. > > Does anyone know where I could find a ready-made compiled > version

Re: Boolean Search using Strings

2015-04-23 Thread Jack Diederich
Here is an old one I wrote. Good for small collections of documents and uncomplicated queries. https://github.com/jackdied/boolmatch -Jack On Thu, Apr 23, 2015 at 10:50 AM, wrote: > Dear Group, > > I want to do the Boolean search over various sentences or documents. > I do not want to use spec

Re: Implementing Python-OAuth2

2011-10-11 Thread Jack Diederich
On Thu, Oct 6, 2011 at 12:15 PM, Jeff Gaynor wrote: > On 10/06/2011 08:34 AM, Kayode Odeyemi wrote: >> I'm working on a pretty large application that I will like to use oauth2 >> on as an authentication and authorization mechanism. > > There are *no* usable OAuth version 2..0 implementation in an

Re: Debugging a difficult refcount issue.

2011-12-18 Thread Jack Diederich
I don't have any great advice, that kind of issue is hard to pin down. That said, do try using a python compile with --with-debug enabled, with that you can turn your unit tests on and off to pinpoint where the refcounts are getting messed up. It also causes python to use plain malloc()s so valgr

Re: Guido at Google

2005-12-21 Thread Jack Diederich
On Wed, Dec 21, 2005 at 01:36:42PM -0500, rbt wrote: > Alex Martelli wrote: > > I don't think there was any official announcement, but it's true -- he > > sits about 15 meters away from me;-). > > For Americans: 15 meters is roughly 50 feet. Right, so that is about three and a half stone? -- ht

Dr. Dobb's Python-URL! - weekly Python news and links (Aug 8)

2006-08-08 Thread Jack Diederich
QOTW: "being able to cook an egg" - Guido Van Rossum in response to the question, "What do you think is the most important skill every programmer should posses?" "I am asking for your forgiveness" - an open letter to Guido by someone who took the "D" in "BDFL" too literally. Parsing a Gramm

Dr. Dobb's Python-URL! - weekly Python news and links (Aug 15)

2006-08-15 Thread Jack Diederich
QOTW: "Consider changing your business plan: write crappy software, charge heaps for support -- it's not a novel idea" - John Machin "To make it run fast, use psyco. To make it even faster, implement the compare function in C." - Raymond Hettinger A Perl convert gladly announces his convers

Re: PySequence_SetItem

2006-08-16 Thread Jack Diederich
On Wed, Aug 16, 2006 at 01:45:44PM -0700, John Machin wrote: > Bill Pursell wrote: > > Bill Pursell wrote: > > > > Also note that the problem goes away if I replace > > the call to PySequence_SetItem with: > > PySequence_SetItem(l, 0, PyInt_FromLong(1L)); > > Are you sure? It should make absolut

Re: PySequence_SetItem

2006-08-16 Thread Jack Diederich
On Wed, Aug 16, 2006 at 02:39:24PM -0700, John Machin wrote: > > Jack Diederich wrote: > > > Changing the PySequence_SetItem to PyList_SetItem and dropping the > > DECREF works for me too (PyList functions steal a reference). I also > > tried setting the list to le

Re: PySequence_SetItem

2006-08-16 Thread Jack Diederich
On Wed, Aug 16, 2006 at 03:25:39PM -0700, John Machin wrote: > > Jack Diederich wrote: > > On Wed, Aug 16, 2006 at 02:39:24PM -0700, John Machin wrote: > > > > > > Jack Diederich wrote: > > > > > > > Changing the PySequence_SetItem to PyList_S

Re: PySequence_SetItem

2006-08-16 Thread Jack Diederich
On Wed, Aug 16, 2006 at 05:13:23PM -0700, John Machin wrote: > > Jack Diederich wrote: > > On Wed, Aug 16, 2006 at 03:25:39PM -0700, John Machin wrote: > > > > > > > > > > > Not the OP's problem, but a bug in the manual: example in the chapter &g

Re: PySequence_SetItem

2006-08-17 Thread Jack Diederich
On Thu, Aug 17, 2006 at 02:35:11PM +0200, Fredrik Lundh wrote: > John Machin wrote: > > > 1. It's also documented as being the recommended way of filling up a > > list after PyList_New. > > since it doesn't work in any existing Python release, it's hardly > "recommended". > > the Python documen

Re: PyThreadState_Swap(NULL)

2006-08-19 Thread Jack Diederich
On Fri, Aug 18, 2006 at 02:21:40PM -0700, Bryan wrote: > > i've written a program that uses python c api code that lives in a > shared library that is loaded by a custom apache module (mod_xxx). this > python c api code all works correctly under our test server and under > apache but only if mo

Re: PyThreadState_Swap(NULL)

2006-08-19 Thread Jack Diederich
On Sat, Aug 19, 2006 at 09:08:21AM -0700, Bryan wrote: > Jack Diederich wrote: > > On Fri, Aug 18, 2006 at 02:21:40PM -0700, Bryan wrote: > >> i've written a program that uses python c api code that lives in a > >> shared library that is loaded by a custo

Dr. Dobb's Python-URL! - weekly Python news and links (Aug 23)

2006-08-23 Thread Jack Diederich
QOTW: "Because there's no chance that the original request is sane." - Georg Brandl (responding to a question involving a Banana) "this is one of your last chances to test the new code in 2.5 before the final release. *Please* try this release out and let us know about any problems you find" - An

Re: how not to run out of memory in cursor.execute

2006-06-05 Thread Jack Diederich
On Mon, Jun 05, 2006 at 07:34:05PM +0100, Steve Holden wrote: > amberite wrote: > > [EMAIL PROTECTED] wrote: > > > >>I am using cx_Oracle and MySQLdb to pull a lot of data from some tables > >>and I find that the cursor.execute method uses a lot of memory that > >>never gets garbage collected. Usi

Re: Writing to a certain line?

2006-06-07 Thread Jack Diederich
On Wed, Jun 07, 2006 at 08:17:22PM +0200, Fredrik Lundh wrote: > Christophe wrote: > > > Use /dev/zero as source and /dev/null as destination :D > > have you tried looping over an endless null-byte stream? > > on a random Linux server, this statement > > >>> for line in open("/dev/zero"): > ..

Dr. Dobb's Python-URL! - weekly Python news and links (Aug 30)

2006-08-30 Thread Jack Diederich
QOTW: "The best working hypothesis is that upgrading will break things." - Grant Edwards "Should I take this to mean: "Don't go near TNEF because your underwear will become carnivorous and consume your genitalia?" - Hendrik van Rooyen Which is better, Turbogears or Rails? Flame on.

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread Jack Diederich
On Wed, Aug 30, 2006 at 08:01:02PM -0700, Aahz wrote: > In article <[EMAIL PROTECTED]>, > Neil Schemenauer <[EMAIL PROTECTED]> wrote: > >Aahz <[EMAIL PROTECTED]> wrote: > >> > >> My company uses 2.2 and 2.3; we hope to drop 2.2 Real Soon Now. > > > >This has been an interesting thread. There has

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 6)

2006-09-06 Thread Jack Diederich
QOTW: "The bad news is that I seem to be an anti-channeler, so my interest is perhaps not a *good* sign" - Jim Jewett "I'm sorry this letter is so long. I didn't have time to write a shorter one." - Blaise Pascal (1657) The Python 2.5 release date is now September 19th. http://www.p

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 14)

2006-09-14 Thread Jack Diederich
QOTW: "Regexps are a brittle tool, best tolerated in small doses." - Tim Peters "Simplicity is prerequisite for reliability" - Edsger W. Dijkstra eval(repr(var)) sometimes works for serialization but don't count on it. http://groups.google.com/group/comp.lang.python/browse_thread/t

Re: new string method in 2.5 (partition)

2006-09-19 Thread Jack Diederich
On Tue, Sep 19, 2006 at 07:23:50PM +, John Salerno wrote: > Bruno Desthuilliers wrote: > > > Err... is it me being dumb, or is it a perfect use case for str.split ? > > Hmm, I suppose you could get nearly the same functionality as using > split(':', 1), but with partition you also get the se

Re: itertools.count(-3)

2006-09-21 Thread Jack Diederich
On Thu, Sep 21, 2006 at 08:29:11AM -0700, Carl Banks wrote: > > [EMAIL PROTECTED] wrote: > > itertools.count docs say: > > Does not currently support python long integers. > > Note, count() does not check for overflow and will return negative > > numbers after exceeding sys.maxint. This behavior m

Re: bz2.readline() slow ?

2006-11-27 Thread Jack Diederich
On Fri, Nov 24, 2006 at 10:11:06AM +, Soeren Sonnenburg wrote: > Dear all, > > I am a bit puzzled, as > > -snip- > import bz2 > f=bz2.BZ2File('data/data.bz2'); > > while f.readline(): > pass > -snip- > > takes twice the time (10 seconds) to read/decode a bz2 file > c

Re: Mark Lutz Python interview

2006-12-13 Thread Jack Diederich
They eventually got this once posted on the website. http://techtalk.imi-us.com/Archives/2006/20061001/ The Lutz interview starts at 10:00 minutes in. -Jack On Fri, Sep 29, 2006 at 11:25:34AM -0700, Mark Lutz wrote: > Python author and trainer Mark Lutz will be interviewed > on the radio show Te

Re: permutations - fast & with low memory consumption?

2006-12-19 Thread Jack Diederich
On Tue, Dec 19, 2006 at 03:14:51PM +0100, Christian Meesters wrote: > Hi, > > I'd like to hack a function which returns all possible permutations as lists > (or tuples) of two from a given list. So far, I came up with this solution, > but it turned out to be too slow for the given problem, because

Re: Py_BuildValue or PyList_SetItem()

2007-01-03 Thread Jack Diederich
On Wed, Jan 03, 2007 at 01:16:38PM -0800, Sheldon wrote: > I have a function that creates python objects out of C arrays and > returns them to Python. Below is a working example that I later want to > expand to return 12 arrays back to Python. The problem is that when I > print out the values in Py

Re: Fast generation of permutations

2006-01-25 Thread Jack Diederich
On Wed, Jan 25, 2006 at 03:33:48PM +0100, Frode ?ijord wrote: > Hi all, > given a sequence of n elements i need to generate all possible > permutations of length k <= n. > > I found an elegant way to do this recursively: > > def comb(items, n): > if n==0: yield [] > else: > for i

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread Jack Diederich
On Wed, Feb 08, 2006 at 12:50:19PM -0800, Swroteb wrote: > Hi there, > > I've got a reasonably sized list of objects that I'd like to pull out > all combinations of five elements from. Right now I have a way to do > this that's quite slow, but manageable. I know there must be a better > way to d

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread Jack Diederich
On Thu, Feb 09, 2006 at 10:23:12AM -0800, [EMAIL PROTECTED] wrote: > Jack Diederich wrote: > > On Wed, Feb 08, 2006 at 12:50:19PM -0800, Swroteb wrote: > > > Hi there, > > > > > > I've got a reasonably sized list of objects that I'd like to pull ou

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread Jack Diederich
liberally snipped out parts On Thu, Feb 09, 2006 at 03:25:18PM -0800, [EMAIL PROTECTED] wrote: > Jack Diederich wrote: > > > > On Wed, Feb 08, 2006 at 12:50:19PM -0800, Swroteb wrote: > > > > > > > > > > I've got a reasonably sized list

Re: how do you pronounce 'tuple'?

2006-02-13 Thread Jack Diederich
On Mon, Feb 13, 2006 at 08:52:06PM +, John Salerno wrote: > Terry Hancock wrote: > > > So what's a 1-element tuple, anyway? A "mople"? "monople"? > > It does seem like this lopsided pythonic creature (1,) ought > > to have a name to reflect its ugly, newbie-unfriendly > > nature. > > > > Are

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Jack Diederich
On Tue, Feb 14, 2006 at 10:40:09AM -0500, Tim Peters wrote: > > the-acid-test-is-whether-you-say-"xor"-with-one-syllable-or-three-ly y'rs - > tim "Zorr!" of course. Saying "All hail the mighty Exclusive Or!" would just sound silly. -jackdied -- http://mail.python.org/mailman/listinfo/python-

Re: Soduku

2006-02-14 Thread Jack Diederich
On Tue, Feb 14, 2006 at 05:32:48PM -0800, Jonathan Gardner wrote: > Here at my job, Python gets no respect. > > A programmer here wanted to see which language among Python, Perl, and > Java was better. So he wrote a Python, perl, and Java version. Except > the Python version was 20x slower than th

Re: Soduku

2006-02-15 Thread Jack Diederich
On Wed, Feb 15, 2006 at 06:56:56PM -0800, Raymond Hettinger wrote: > [Jack Diederich] > > Is my math off or does 27ms mean 0.027 seconds? On my laptop (1.3GHz) > > an empty python program takes 10ms to run (0.010 secs). I ask out of > > vanity, my own solver takes .15 secon

Re: Proper class initialization

2006-03-01 Thread Jack Diederich
On Wed, Mar 01, 2006 at 09:25:36PM +0100, Christoph Zwerschke wrote: > Usually, you initialize class variables like that: > > class A: > sum = 45 > > But what is the proper way to initialize class variables if they are the > result of some computation or processing as in the following silly

Re: Adding new methods to new-style classes dynamically

2005-05-05 Thread Jack Diederich
On Thu, May 05, 2005 at 01:35:09AM -0700, Max Derkachev wrote: > Good day to all. > > Some time ago I'd been playing with a framework which uses dynamic > class creation havily. Say, I could do: > > #well, try this with the new-style class > class A(object): > pass > > # the new-style __dic

Re: Is Python suitable for a huge, enterprise size app?

2005-05-18 Thread Jack Diederich
On Wed, May 18, 2005 at 08:37:00AM -0700, john67 wrote: > The company I work for is about to embark on developing a commercial > application that will cost us tens-of-millions to develop. When all is > said and done it will have thousands of business objects/classes, some > of which will have hun

Re: MUD Client and Python Plugin Framework

2005-05-23 Thread Jack Diederich
On Mon, May 23, 2005 at 10:51:47AM -0700, Discipulus wrote: > Hey, > I'm contemplating starting a MUD client in Python, and I would like to > make it so that people can write their own plugins, but I need ideas on > the framework. Any suggestions? Use Lyntin? (http://lyntin.sourceforge.net/) An ex

Re: Descriptor/Decorator challenge

2007-03-07 Thread Jack Diederich
On Tue, Mar 06, 2007 at 11:44:48AM -0800, Arnaud Delobelle wrote: > On 5 Mar, 18:59, "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote: > [snip] > > Well in fact I couldn't help but try to improve it a bit. Objects now > > don't need a callerclass attribute, instead all necessary info is > > stored in a

  1   2   >