file reading by record separator (not line by line)

Steve Howell showell30 at yahoo.com
Sat Jun 2 12:12:54 EDT 2007


--- Steve Howell <showell30 at yahoo.com> wrote:
> 
> Can I suggest a minor optimization?
> 
> Instead of this...
> 
>     def get_predicate(arg):
>         return arg if callable(arg) else (
>                arg.__eq__ if hasattr(arg,'__eq__')
> else
>                lambda item: item == arg)
> 

Never mind, I understand what you're doing now.  The
"arg" variable through me off, so I'll make the even
more minor suggestion that a better variable name
might help here.  Perhaps "delim"?




       
____________________________________________________________________________________
Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php



More information about the Python-list mailing list