Gabriel Genellina wrote:
def readline(self, size=None):
if size == None:
line = self.file.readline()
else:
line = self.file.readline(size)
# etc., etc.
Not obvious from the docs, but readline(-1) should be the same as
readline().
(In 3.0b2, Non
En Fri, 01 Aug 2008 16:21:26 -0300, kj <[EMAIL PROTECTED]> escribi�:
In <[EMAIL PROTECTED]> Miles
<[EMAIL PROTECTED]> writes:
On Wed, Jul 30, 2008 at 5:52 PM, kj <[EMAIL PROTECTED]> wrote:
I know that I could rewrite the method like this:
def readline(self, size=None):
if size ==
In <[EMAIL PROTECTED]> Miles <[EMAIL PROTECTED]> writes:
>On Wed, Jul 30, 2008 at 5:52 PM, kj <[EMAIL PROTECTED]> wrote:
>> I know that I could rewrite the method like this:
>>
>>def readline(self, size=None):
>>if size == None:
>>line = self.file.readline()
>>else:
On Wed, Jul 30, 2008 at 5:52 PM, kj <[EMAIL PROTECTED]> wrote:
> I know that I could rewrite the method like this:
>
>def readline(self, size=None):
>if size == None:
>line = self.file.readline()
>else:
>line = self.file.readline(size)
># etc., et
kj wrote:
I'm trying to subclass file, overriding the readline method. The
new method definition begins with
def readline(self, size=None):
line = self.file.readline(size)
# etc., etc.
...where the self.file attribute is a regular file object.
This works fine if I invoke t