Defining a method final

David LeBlanc whisper at oz.net
Tue Jun 11 09:52:27 EDT 2002


"final" is a Java concept not supported in Python.

You could possibly simulate it with an 'init' method called after an
instance of a subclass is created to adjust the dictionary so that the base
classes' method is always called in preference to any same-named method in
the derived class(es). Potentially this could even be done in the derived
classes' __init__ method that calls the base class __init__ and thus not
need an additional explict initialization step.

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Fabio Corneti
> Sent: Tuesday, June 11, 2002 4:36
> To: python-list at python.org
> Subject: Defining a method final
>
>
> Is there any way to define a method final in Python?
> I've searched through the docs and through the web, but
> it seems there's no way to to such a thing using standard
> language statements. Some suggestions?
>
> --
> Fabio Corneti
> Network Administrator
> fcorneti AT libero DOT it
> --
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list