Re: matching objects by a tuple field criterion

2007-06-10 Thread bullockbefriending bard
> There are certainly cases where the speedup is tremendous - think of a > single integer in the first criteria - but then the overall performance > depends on the real-live queries. If lot's of wildcards are used, you > might end up slower if the tree-walk takes more time than the > C-implemented

Re: matching objects by a tuple field criterion

2007-06-10 Thread Diez B. Roggisch
bullockbefriending bard schrieb: >> Instead of passing a wild-card tuple like (*,*,*,4,*,*) simply pass the >> integer you want to match and the position you want to match it in. > > for sure. that was more for expository purpose rather than how i was > planning to go about it. > > >> As a gener

Re: matching objects by a tuple field criterion

2007-06-10 Thread bullockbefriending bard
quite so, i rephrased docstring to be: """criteria is an iterable containing either '*' instances or strings of comma-separated integers. e.g. ['*','1,2,3', '11,12']""" thanks very much for the idea! upon further reflection, this seems to be a more elegant solution for my case than the ad-hoc g

Re: matching objects by a tuple field criterion

2007-06-10 Thread John Machin
On Jun 10, 10:32 pm, bullockbefriending bard <[EMAIL PROTECTED]> wrote: > quite so, i rephrased docstring to be: > > """criteria is an iterable containing either '*' instances or strings > of comma-separated integers. e.g. ['*','1,2,3', '11,12']""" > > thanks very much for the idea! upon further

Re: matching objects by a tuple field criterion

2007-06-10 Thread John Machin
On Jun 10, 8:58 pm, bullockbefriending bard <[EMAIL PROTECTED]> wrote: > i have a large collection of python objects, each of which contains an > integer 6-tuple as part of its data payload. what i need to be able to > do is select only those objects which meet a simple tuple element > wildcard mat

Re: matching objects by a tuple field criterion

2007-06-10 Thread bullockbefriending bard
> Instead of passing a wild-card tuple like (*,*,*,4,*,*) simply pass the > integer you want to match and the position you want to match it in. for sure. that was more for expository purpose rather than how i was planning to go about it. > As a generator expression: > > (obj for obj in list_of_

Re: matching objects by a tuple field criterion

2007-06-10 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: > bullockbefriending bard schrieb: >> i have a large collection of python objects, each of which contains an >> integer 6-tuple as part of its data payload. what i need to be able to >> do is select only those objects which meet a simple tuple element >> wildcard matching

Re: matching objects by a tuple field criterion

2007-06-10 Thread Diez B. Roggisch
bullockbefriending bard schrieb: > i have a large collection of python objects, each of which contains an > integer 6-tuple as part of its data payload. what i need to be able to > do is select only those objects which meet a simple tuple element > wildcard matching criterion. e.g. given the follow

Re: matching objects by a tuple field criterion

2007-06-10 Thread Steven D'Aprano
On Sun, 10 Jun 2007 03:58:44 -0700, bullockbefriending bard wrote: > i have a large collection of python objects, each of which contains an > integer 6-tuple as part of its data payload. what i need to be able to > do is select only those objects which meet a simple tuple element > wildcard matchi

matching objects by a tuple field criterion

2007-06-10 Thread bullockbefriending bard
i have a large collection of python objects, each of which contains an integer 6-tuple as part of its data payload. what i need to be able to do is select only those objects which meet a simple tuple element wildcard matching criterion. e.g. given the following python objects: object A include