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
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
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
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
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
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
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
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
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
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
On Fri, Jan 28, 2011 at 1:32 PM, Raymond Hettinger wrote:
> I hoping a new trend will start with dev's putting direct
> source code links in their documentation:
>
> http://rhettinger.wordpress.com/2011/01/28/open-your-source-more/
>
> I'm looking for more examples of projects that routinely
> li
On Thu, Oct 7, 2010 at 11:55 AM, Capstick, Antony H
wrote:
> I am looking for an experienced Person .. to develop and implement a
> graphical track map operating in MS
> Windows that will be used to display graphical information for a new Disney
> attraction.
1) http://www.python.org/community/j
On Thu, Oct 7, 2010 at 7:56 AM, Diez B. Roggisch wrote:
> Chris Withers writes:
>>
>> Is it just me or does the mailing of just about every single
>> python-based project mailing list with a 90% form email advertising a
>> conference that only has one python track *and* clashes with PyCon
>> feel
On Thu, Jul 8, 2010 at 10:02 PM, MRAB wrote:
> sturlamolden wrote:
>> It seems "y is not x" fits well with spoken English, but it is also a
>> bit surprising that "y is not x" does not mean "y is (not x)" but "not
>> (y is x)". Why does Python reorder is and not operators, and what are
>> the form
On Thu, Jun 17, 2010 at 12:58 PM, Stephen Hansen
wrote:
> On 6/17/10 10:01 AM, Ethan Furman wrote:
>> Stephen Hansen wrote:
>>> On 6/17/10 9:12 AM, pyt...@bdurham.com wrote:
>>>
>>> Now, this is all IMHO: the style guide does not define any 'guidelines'
>>> on this, except that its okay to use "fr
On Sat, Jun 12, 2010 at 11:09 PM, rantingrick wrote:
>
> -
> Where is the community?
> -
[snip]
>
> You people need to get a life, drop your narcissistic attitudes and be
> more helpful, friendly, and welcoming to the wider world. This
> community i
On Tue, Jun 8, 2010 at 6:47 PM, Mark Young wrote:
> According to the Oxford Dictionary:
>
> fish noun, verb noun (pl.fish or fishes)Fish is the usual plural form. The
> older form, fishes, can be used to refer to different kinds of fish...
>
> However, I would correct anyone that ever used "fishes
On Thu, May 20, 2010 at 8:13 PM, Stef Mientki wrote:
> hello,
>
> This might be a strange question, but as a practical guy, I'm not searching
> for the best solution, but for a practical solution.
>
> I've a class which I've used very extensively.
> Now I want to extend that class with an action o
On Tue, Apr 6, 2010 at 2:11 PM, Gustavo Narea wrote:
> Hello!
>
> Could you please confirm whether my understanding of equality
> operations in sets and lists is correct? This is how I think things
> work, partially based on experimentation and the online documentation
> for Python:
>
> When you c
On Fri, Mar 26, 2010 at 10:49 AM, kj wrote:
>
>
> What's the word on using "classes as namespaces"? E.g.
>
> class _cfg(object):
> spam = 1
> jambon = 3
> huevos = 2
>
> breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos)
Classes as namespaces are a valid use case (I do it all the time).
On Tue, Mar 16, 2010 at 2:18 AM, Chris Rebert wrote:
> On Mon, Mar 15, 2010 at 11:01 PM, Josh English
> wrote:
>> I have a large program with lots of data stored in XML. I'm upgrading
>> my GUI to use ObjectListView, but with my data in XML, I don't have
>> regular objects to interact with the OL
On Sat, Mar 13, 2010 at 12:10 PM, Jon Clements wrote:
> On 13 Mar, 16:42, Jack Diederich wrote:
>> On Sat, Mar 13, 2010 at 11:19 AM, Jon Clements wrote:
>> > This is semi-experimental and I'd appreciate opinions of whether it's
>> > the correct design appro
On Sat, Mar 13, 2010 at 12:03 PM, JLundell wrote:
> I've got a subclass of fractions.Fraction called Value; it's a mostly
> trivial class, except that it overrides __eq__ to mean 'nearly equal'.
> However, since Fraction's operations result in a Fraction, not a
> Value, I end up with stuff like th
On Sat, Mar 13, 2010 at 11:19 AM, Jon Clements wrote:
> This is semi-experimental and I'd appreciate opinions of whether it's
> the correct design approach or not. It seems like a good idea, but it
> doesn't mean it is.
>
> I have a class 'A', this provides standard support functions and
> excepti
On Fri, Mar 5, 2010 at 6:09 PM, Steven D'Aprano
wrote:
> On Fri, 05 Mar 2010 15:58:01 -0500, Jack Diederich wrote:
>
>>>> So, the pythonic way to check for True/False should be:
>>>>
>>>>>>> 1 is True
>>>> False
>>>
&
On Fri, Mar 5, 2010 at 2:54 PM, Steven D'Aprano
wrote:
> On Fri, 05 Mar 2010 15:01:23 -0400, Rolando Espinoza La Fuente wrote:
>
>> On Fri, Mar 5, 2010 at 2:32 PM, mk wrote:
>>> Arnaud Delobelle wrote:
>>>
>>> 1 == True
True
>>>
>>> 0 == False
True
So wha
On Wed, Mar 3, 2010 at 5:18 PM, Jonathan Gardner
wrote:
> On Wed, Mar 3, 2010 at 1:11 PM, mk wrote:
>>
>> Or I could make my life simpler and use global variable. :-)
>>
>
> Ding ding ding!
>
> 90% of Design Patterns is making Java suck less.
>
> Other languages don't necessarily suffer from Java
On Wed, Mar 3, 2010 at 12:36 PM, Xah Lee wrote:
[snip]
Xah Lee is a longstanding usenet troll. Don't feed the trolls.
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Feb 24, 2010 at 4:54 PM, Jonathan Gardner
wrote:
> On Wed, Feb 24, 2010 at 12:23 PM, Andreas Waldenburger
> wrote:
>>
>> Now my question is this: How do I kill these people without the
>> authorities thinking they didn't deserve it?
>>
>
> kill -9 seems to work for me.
kill -1 -1
Back i
On Fri, Feb 5, 2010 at 11:31 AM, Gerald Britton
wrote:
> I think it's because when you do ['a'].extend([]) or whatever, the
> result is whatever the method "extend" returns. But "extend" has no
> return value, hence you will see None if you do this interactively.
>
That sums it up. In Python th
On Sat, Jan 9, 2010 at 2:53 PM, Jan Kaliszewski wrote:
> Hello,
>
> I have a question: are class decorator planned to be backported from 3.x?
>
Eh? Class decorators have been in the 2.x series since 2.6.
If you want to know more about class decorators check out this talk
from PyCon 2009 http://p
On Sat, Jan 2, 2010 at 10:38 PM, n00m wrote:
> On Jan 3, 5:30 am, Steve Holden wrote:
>> Zhu Sha Zang wrote:
>> >> [stuff and nonsense from a third party]
>> > WTF?
>>
>> We do get the occasional bigot dropping in from time to time. Best to
>> ignore them 'til they go away.
>>
> And who are YOU?
On Sat, Nov 7, 2009 at 4:39 PM, vsoler wrote:
> In the accounting department I am working for we are from time to time
> confronted to the following problem:
[snip]
> For example, say that the customer has the following outstanding
> invoices: $300, $200, $50; and say that the check is for $250.
It's Xah Lee, he's been trolling this and every other programing
language group for over 10 years (preferably all at once). Let it go.
On Sat, Oct 3, 2009 at 2:53 AM, Chris Withers wrote:
> Xah Lee wrote:
>>
>> Haskell has a new logo. A fantastic one. Beautiful. For creator,
>> context, detail,
On Thu, Oct 1, 2009 at 1:22 AM, Lanny wrote:
> I've been thinking about putting together a text based RPG written
> fully in Python, possibly expanding to a MUD system. I'd like to know
> if anyone feels any kind of need for this thing or if I'd be wasting
> my time, and also if anyone would be in
On Tue, Sep 22, 2009 at 7:25 PM, Nobody wrote:
> On Mon, 21 Sep 2009 16:33:08 -0400, Jack Diederich wrote:
>
>>> AIUI, as a python string is imutable, a slice of a string is a
>>> new string which points (C char *) to the start of the slice data
>>> and with a
On Mon, Sep 21, 2009 at 4:00 PM, Rob Williscroft wrote:
> AIUI, as a python string is imutable, a slice of a string is a
> new string which points (C char *) to the start of the slice data
> and with a length that is the length of the slice, about 8 bytes
> on 32 bit machine.
Not in CPython. Whi
On Mon, Jul 20, 2009 at 5:57 AM, casebash wrote:
> Hi,
>
> I have searched this list and found out that Python doesn't have a
> mutable string class (it had an inefficient one, but this was removed
> in 3.0). Are there any libraries outside the core that offer this?
It depends on how mutable you w
On Mon, Jul 20, 2009 at 10:00 AM, Steven
D'Aprano wrote:
> On Mon, 20 Jul 2009 09:34:24 +, Sion Arrowsmith wrote:
>
>> Terry Reedy wrote:
>>>Sion Arrowsmith wrote:
>>>> Jack Diederich wrote:
>>>>> It isn't an OrderedDict thing, it
On Fri, Jul 17, 2009 at 10:35 AM, Xavier Ho wrote:
> I changed my code to the following:
>
> def nPrime(self, n):
> "Returns nth prime number, the first one being 2, where n = 0. When
> n = 1, it returns 3."
> for x in range(n+2):
> try:
> return sel
On Thu, Jul 16, 2009 at 2:21 AM, Mark Summerfield wrote:
> Hi,
>
> I'm just wondering why <, <=, >=, and > are not supported by
> collections.OrderedDict:
>
> >>> d1 = collections.OrderedDict((("a",1),("z",2),("k",3)))
> >>> d2 = d1.copy()
> >>> d2["z"] = 4
> >>> d1 == d2
> False
>
On Tue, Jul 14, 2009 at 5:44 PM, Ken Seehart wrote:
> Almost every time I use decorators, I find myself wishing I had access
> to the local namespace of the context from which the decorator is
> executed. In practice, decorator is being applied to a method, so the
> namespace in question would be
On Thu, Jul 2, 2009 at 2:36 PM, Carl Banks wrote:
> On Jul 2, 3:12 am, Ulrich Eckhardt wrote:
>> Bearophile wrote:
>> > Ulrich Eckhardt:
>> >> a way to automatically release the resource, something
>> >> which I would do in the destructor in C++.
>>
>> > Is this helpful?
>> >http://effbot.org/pyre
On Sat, Jun 13, 2009 at 2:11 PM, kj wrote:
>
>
> Switching from Perl here, and having a hard time letting go...
>
> Suppose I have an "array" foo, and that I'm interested in the 4th, 8th,
> second, and last element in that array. In Perl I could write:
>
> my @wanted = @foo[3, 7, 1, -1];
>
> I wa
On Thu, Jun 11, 2009 at 2:54 PM, Terry Reedy wrote:
> Jack Diederich wrote:
>>
>> On Thu, Jun 11, 2009 at 12:03 AM, David M. Wilson wrote:
>> [snip]
>>>
>>> I found my answer: Python 2.6 introduces heap.merge(), which is
>>> designed exactly for th
On Thu, Jun 11, 2009 at 12:03 AM, David M. Wilson wrote:
[snip]
> I found my answer: Python 2.6 introduces heap.merge(), which is
> designed exactly for this.
Thanks, I knew Raymond added something like that but I couldn't find
it in itertools.
That said .. it doesn't help. Aside, heapq.merge fit
On Wed, Jun 10, 2009 at 6:24 PM, David Wilson wrote:
> During a fun coding session yesterday, I came across a problem that I
> thought was already solved by itertools, but on investigation it seems
> it isn't.
>
> The problem is simple: given one or more ordered sequences, return
> only the objects
On Wed, Apr 29, 2009 at 11:31 PM, wrote:
> Is anyone using telnetlib in python-3.0? If so are you having any
> success? Using the example at the bottom of the telnetlib doc page I
> cannot seem to get any joy at all. I can make a connection, but write
> (command) seems to do nothing.
3.0 had
On Wed, Apr 15, 2009 at 3:41 AM, Fabian Lanze
wrote:
>
> I want to realize the following: I want to measure the time it takes to
> build up a telnet connection to a known host (ip/port). I tried to use
> subprocess.Popen to build the telnet connection and then to catch the
> "Trying to connect..."
At the PyCon core python sprint I suggested this game and it got some laughs.
So I put together a webpage for the game of:
German, American, or Other?
There is a list of about 30 core devs' last names. Highlight the white text
on white background for the [mostly correct] answers.
http://jackd
On Fri, Mar 23, 2007 at 03:11:35PM -0600, Matt Garman wrote:
> I'm trying to use Python to work with large pipe ('|') delimited data
> files. The files range in size from 25 MB to 200 MB.
>
> Since each line corresponds to a record, what I'm trying to do is
> create an object from each record. H
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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"):
> ..
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
On Fri, May 19, 2006 at 02:21:39AM -0700, malv wrote:
> Once you get involved in larger projects, the dynamic nature of the
> programming tool becomes much more important. I mean by this, the
> ability to stop running code, modify or add to it and continue without
> having to re-establish the state
On Tue, May 16, 2006 at 01:24:25PM +, John Bokma wrote:
> [EMAIL PROTECTED] wrote:
>
> > It's quite strange, after calling the script several times it started
> > to work; but sometimes the error occurs again. Maybe google has
> > technical probs.
>
> Yup, I've seen exactly the same behavoir.
On Wed, May 10, 2006 at 10:00:38AM -0700, malv wrote:
> This is a question that comes up almost continuously for at least six
> years now.
> For Python users having to deal with major real-life applications, this
> may make them think twice about the future suitability of Python as a
> competitive
On Fri, May 05, 2006 at 05:26:26PM -0700, Xah Lee wrote:
> Python, Lambda, and Guido van Rossum
[snip]
Foxtrot Oscar Alpha Delta
Others have said banning this troll would be wrong or undemocratic
but let's be sane: he has wasted hundreds of hours of other people's
time and hurt newbies especially
On Thu, May 04, 2006 at 02:08:30PM -0400, Steven Watanabe wrote:
> I'm trying to do something like this in Python 2.4.3:
>
> class NamedSet(set):
> def __init__(self, items=(), name=''):
> set.__init__(self, items)
> self.name = name
>
> class NamedList(list):
> def __init__(self, ite
On Mon, Apr 17, 2006 at 09:41:37AM -0700, Jonathan Amsterdam wrote:
> If you don't want to call it deadlock, fine, but the program execution
> I describe will make no progress to the end of time. Thread 2 can never
> put anything in the queue, because Thread 1 holds M, and Thread 1 will
> never rel
On Sat, Apr 15, 2006 at 04:04:44AM +1000, Steven D'Aprano wrote:
> I came across an interesting (as in the Chinese curse) problem today. I
> had to modify a piece of code using generator expressions written with
> Python 2.4 in mind to run under version 2.3, but I wanted the code to
> continue to u
On Tue, Apr 11, 2006 at 09:29:10AM -0700, Dave Opstad wrote:
> I just looked through the Python/C API reference for 2.4.3 and didn't
> see anything about using sets. I'd been expecting things like PySet_New,
> PySet_Check etc.
There is a public C API starting in 2.5, the progression for sets was
Xah, is that you?
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Mar 24, 2006 at 09:33:55PM +0100, Andreas R?sdal wrote:
> Hi,
>
> I'm using the Python profiler to optimize a pathfinding algorithm of a
> game, and would like some help from someone who knows how to improve the
> performance of Python code. The algorithm is A-Star, and it works
> correctl
On Wed, Mar 15, 2006 at 04:50:31PM -0800, Paul Rubin wrote:
> "kpp9c" <[EMAIL PROTECTED]> writes:
> > self._all_states |= set(key[i] for key in probabilities)
> > I am running:
> > Python 2.3 (#1, Sep 13 2003, 00:49:11)
>
> generator comprehensions are new in 2.4. Try:
>
>self._all_state
On Thu, Mar 09, 2006 at 02:04:45PM -0800, mh wrote:
> So on most modules I import, I can access the .__file__ attribute to
> find the implementation. ie:
> >>> import time
> >>> time.__file__
> '/data1/virtualpython/lib/python2.3/lib-dynload/timemodule.so'
> >>> import socket
> >>> socket.__file__
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
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
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
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-
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
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
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
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
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
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
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
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
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
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
1 - 100 of 153 matches
Mail list logo