Memory error due to big input file
Chris Rebert
clp2 at rebertia.com
Mon Jul 13 18:02:37 EDT 2009
On Mon, Jul 13, 2009 at 2:51 PM, Vilya Harvey<vilya.harvey at gmail.com> wrote:
> 2009/7/13 Aaron Scott <aaron.hildebrandt at gmail.com>:
>>> BTW, you should derive all your classes from something. If nothing
>>> else, use object.
>>> class textfile(object):
>>
>> Just out of curiousity... why is that? I've been coding in Python for
>> a long time, and I never derive my base classes. What's the advantage
>> to deriving them?
>
> class Foo:
>
> uses the old object model.
>
> class Foo(object):
>
> uses the new object model.
>
> See http://docs.python.org/reference/datamodel.html (specifically
> section 3.3) for details of the differences.
Note that Python 3.0 makes explicitly subclassing `object` unnecessary
since it removes old-style classes; a class that doesn't explicitly
subclass anything will implicitly subclass `object`.
Cheers,
Chris
--
http://blog.rebertia.com
More information about the Python-list
mailing list