On Wed, 1 Sep 2010 09:24:23 am Gregory, Matthew wrote:
> Hi all,
>
> In the 2nd edition of Python Cookbook, Mark Lutz writes the intro to
> Chapter 2 (Files) and gives the following example of polymorphism for
> file like objects (adapted for brevity):
[...]
> I understand this code and the polymor
Hi all,
In the 2nd edition of Python Cookbook, Mark Lutz writes the intro to Chapter 2
(Files) and gives the following example of polymorphism for file like objects
(adapted for brevity):
def firstword(line):
print line.split()[0]
def scanner(fileobject, linehandler):
for line in fileo