Re: [Tutor] using in over several entities

2007-08-25 Thread Tino Dai
On 8/24/07, Chris Calloway <[EMAIL PROTECTED]> wrote Thanks everybody for their assistance! Makes my code a lot more elegant. -Tino ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] using in over several entities

2007-08-24 Thread Chris Calloway
Alan Gauld wrote: > "Chris Calloway" <[EMAIL PROTECTED]> wrote > > dbs = set(['oracle','mysql','postgres','infomix','access']) > mine = set(['oracle','mysql','bdb']) > dbs & mine >> set(['oracle', 'mysql']) > dbs - mine >> set(['access', 'infomix', 'postgres']) > > Interesting. I

Re: [Tutor] using in over several entities

2007-08-24 Thread Alan Gauld
"Chris Calloway" <[EMAIL PROTECTED]> wrote > >>> dbs = set(['oracle','mysql','postgres','infomix','access']) > >>> mine = set(['oracle','mysql','bdb']) > >>> dbs & mine > set(['oracle', 'mysql']) > >>> dbs - mine > set(['access', 'infomix', 'postgres']) Interesting. I didn't know about the & an

Re: [Tutor] using in over several entities

2007-08-24 Thread Alan Gauld
"Tino Dai" <[EMAIL PROTECTED]> wrote > dbs= ['oracle','mysql','postgres','infomix','access'] > > and we wanted to do this: > > if 'oracle' in dbs or 'mysql' in dbs or 'bdb' in dbs: > <... do something ...> > > Is there a short way or writing this? Something like >('oracle','mysql','bdb'

Re: [Tutor] using in over several entities

2007-08-24 Thread Chris Calloway
Tino Dai wrote: > I am wondering about a short cut to doing this. Let's say that we > have an array: > > dbs= ['oracle','mysql','postgres','infomix','access'] > > and we wanted to do this: > > if 'oracle' in dbs or 'mysql' in dbs or 'bdb' in dbs: ><... do something ...> > > Is there a

Re: [Tutor] using in over several entities

2007-08-24 Thread Kent Johnson
Tino Dai wrote: > Hi there, > > I am wondering about a short cut to doing this. Let's say that we > have an array: > > dbs= ['oracle','mysql','postgres','infomix','access'] > > and we wanted to do this: > > if 'oracle' in dbs or 'mysql' in dbs or 'bdb' in dbs: ><... do something ...> >

[Tutor] using in over several entities

2007-08-24 Thread Tino Dai
Hi there, I am wondering about a short cut to doing this. Let's say that we have an array: dbs= ['oracle','mysql','postgres','infomix','access'] and we wanted to do this: if 'oracle' in dbs or 'mysql' in dbs or 'bdb' in dbs: <... do something ...> Is there a short way or writing this? S