Re: Record seperator

2011-08-27 Thread ChasBrown
On Aug 27, 10:45 am, Roy Smith wrote: > In article <4e592852$0$29965$c3e8da3$54964...@news.astraweb.com>, >  Steven D'Aprano wrote: > > > open("file.txt")   # opens the file > >  .read()           # reads the contents of the file > >  .split("\n\n")    # splits the text on double-newlines. > > Th

Re: testing if a list contains a sublist

2011-08-16 Thread ChasBrown
On Aug 16, 1:37 am, Steven D'Aprano wrote: > On Tue, 16 Aug 2011 04:14 pm ChasBrown wrote: > > > > > On Aug 15, 4:26 pm, Johannes wrote: > >> hi list, > >> what is the best way to check if a given list (lets call it l1) is > >> totally contained

Re: testing if a list contains a sublist

2011-08-16 Thread ChasBrown
On Aug 15, 11:51 pm, Laszlo Nagy wrote: > >> hi list, > >> what is the best way to check if a given list (lets call it l1) is > >> totally contained in a second list (l2)? > > >> for example: > >> l1 = [1,2], l2 = [1,2,3,4,5] ->  l1 is contained in l2 > >> l1 = [1,2,2,], l2 = [1,2,3,4,5] ->  l1 is

Re: testing if a list contains a sublist

2011-08-15 Thread ChasBrown
On Aug 15, 4:26 pm, Johannes wrote: > hi list, > what is the best way to check if a given list (lets call it l1) is > totally contained in a second list (l2)? > > for example: > l1 = [1,2], l2 = [1,2,3,4,5] -> l1 is contained in l2 > l1 = [1,2,2,], l2 = [1,2,3,4,5] -> l1 is not contained in l2 > l

Re: testing if a list contains a sublist

2011-08-15 Thread ChasBrown
On Aug 15, 4:26 pm, Johannes wrote: > hi list, > what is the best way to check if a given list (lets call it l1) is > totally contained in a second list (l2)? > > for example: > l1 = [1,2], l2 = [1,2,3,4,5] -> l1 is contained in l2 > l1 = [1,2,2,], l2 = [1,2,3,4,5] -> l1 is not contained in l2 > l

Re: testing if a list contains a sublist

2011-08-15 Thread ChasBrown
On Aug 15, 4:26 pm, Johannes wrote: > hi list, > what is the best way to check if a given list (lets call it l1) is > totally contained in a second list (l2)? > > for example: > l1 = [1,2], l2 = [1,2,3,4,5] -> l1 is contained in l2 > l1 = [1,2,2,], l2 = [1,2,3,4,5] -> l1 is not contained in l2 > l

Re: Why won't this decorator work?

2011-07-02 Thread ChasBrown
On Jul 2, 11:08 am, John Salerno wrote: > On Jul 2, 12:33 pm, MRAB wrote: > > > > > On 02/07/2011 17:56, John Salerno wrote: > > > > I thought I had finally grasped decorators, but the error I'm getting > > > ('str' type is not callable) is confusing me. > > > def move(roll): > > > return 'Y

Re: Why won't this decorator work?

2011-07-02 Thread ChasBrown
On Jul 2, 11:08 am, John Salerno wrote: > On Jul 2, 12:33 pm, MRAB wrote: > > > > > On 02/07/2011 17:56, John Salerno wrote: > > > > I thought I had finally grasped decorators, but the error I'm getting > > > ('str' type is not callable) is confusing me. > > > def move(roll): > > > return 'Y

Re: Why won't this decorator work?

2011-07-02 Thread ChasBrown
On Jul 2, 11:08 am, John Salerno wrote: > On Jul 2, 12:33 pm, MRAB wrote: > > > > > On 02/07/2011 17:56, John Salerno wrote: > > > > I thought I had finally grasped decorators, but the error I'm getting > > > ('str' type is not callable) is confusing me. > > > def move(roll): > > > return 'Y

Re: Multiple instances and wrong parental links

2011-01-01 Thread ChasBrown
On Jan 1, 5:59 pm, Josh English wrote: > I have hit yet another wall. I am dynamically creating a class and then > creating instances of that class. The class relies on a second class to store > a list of objects. (This is simplified from the the original by a factor of > about 20. The real pro

Re: How can a function find the function that called it?

2010-12-24 Thread ChasBrown
On Dec 24, 8:24 am, kj wrote: > I want to implement a frozen and ordered dict. > > I thought I'd implement it as a subclass of collections.OrderedDict > that prohibits all modifications to the dictionary after it has > been initialized. > > In particular, calling this frozen subclass's update meth