Re: multiplication of lists of strings

2008-03-08 Thread castironpi
On Mar 5, 2:16 am, Bruno Desthuilliers bruno.
[EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] a écrit :
 (snip)

  That reminds me:  Is there a generic 'relation' pattern/recipie, such
  as finding a computer that's paired with multiple users, each of who
  are paired with multiple computers, without maintaining dual-
  associativity?

 Yes : use a relational database.

No performance hit.  Can I write an ad hoc relational class structure?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: multiplication of lists of strings

2008-03-08 Thread castironpi
On Mar 8, 12:04 pm, [EMAIL PROTECTED] wrote:
 On Mar 5, 2:16 am, Bruno Desthuilliers bruno.

 [EMAIL PROTECTED] wrote:
  [EMAIL PROTECTED] a écrit :
  (snip)

   That reminds me:  Is there a generic 'relation' pattern/recipie, such
   as finding a computer that's paired with multiple users, each of who
   are paired with multiple computers, without maintaining dual-
   associativity?

  Yes : use a relational database.

 No performance hit.  Can I write an ad hoc relational class structure?

What do you think of this solution?

http://jtauber.com/blog/2005/11/10/relational_python:_basic_class_for_relations/

http://www.google.com/search?hl=enq=python+relational+class+-database
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: multiplication of lists of strings

2008-03-05 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit :
(snip)
 
 That reminds me:  Is there a generic 'relation' pattern/recipie, such
 as finding a computer that's paired with multiple users, each of who
 are paired with multiple computers, without maintaining dual-
 associativity?
 
Yes : use a relational database.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: multiplication of lists of strings

2008-03-04 Thread Gabriel Genellina
En Tue, 04 Mar 2008 23:50:49 -0200, Jason [EMAIL PROTECTED] escribió:

 How could I return a list or tuple of each unique combination of a given
 set of lists (perhaps from a dict or a list).  This means the number of
 lists are not known nor is the length of each.

Use the Google interfase for this group:  
http://groups.google.com/group/comp.lang.python/
Type unique combinations lists in the text box; press Search in this  
group. The very first result contains some answers to your question.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: multiplication of lists of strings

2008-03-04 Thread Jason Galyon
Gabriel Genellina wrote:
 En Tue, 04 Mar 2008 23:50:49 -0200, Jason [EMAIL PROTECTED] escribió:
 
 How could I return a list or tuple of each unique combination of a given
 set of lists (perhaps from a dict or a list).  This means the number of
 lists are not known nor is the length of each.
 
 Use the Google interfase for this group: 
 http://groups.google.com/group/comp.lang.python/
 Type unique combinations lists in the text box; press Search in this 
 group. The very first result contains some answers to your question.
 
found it, the referenced cookbook recipe is perfect.

Thanks, Gabriel
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: multiplication of lists of strings

2008-03-04 Thread castironpi
On Mar 4, 9:46 pm, Jason Galyon [EMAIL PROTECTED] wrote:
 Gabriel Genellina wrote:
  En Tue, 04 Mar 2008 23:50:49 -0200, Jason [EMAIL PROTECTED] escribió:

  How could I return a list or tuple of each unique combination of a given
  set of lists (perhaps from a dict or a list).  This means the number of
  lists are not known nor is the length of each.

  Use the Google interfase for this group:
 http://groups.google.com/group/comp.lang.python/
  Type unique combinations lists in the text box; press Search in this
  group. The very first result contains some answers to your question.

 found it, the referenced cookbook recipe is perfect.

 Thanks, Gabriel

That reminds me:  Is there a generic 'relation' pattern/recipie, such
as finding a computer that's paired with multiple users, each of who
are paired with multiple computers, without maintaining dual-
associativity?

Good:

py user.getcomputers()
[ Compie1, Compie2 ]

Bad:

user._computers.add( compieN )
compieN._users.add( user )

?
-- 
http://mail.python.org/mailman/listinfo/python-list