A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-list/1999-September/013923.html below:

Class in class

Class in class Class in classFredrik Lundh fredrik at pythonware.com
Mon Sep 6 06:07:03 EDT 1999
Gurvijay Singh Bhatti <khalsa at acay.com.au> wrote:
> Like C++ and Java, is it possible to declare a class in a class?

yes.

> If it is then could you tell how?

class foo:
    class bar:
        pass

object = foo.bar()

however, since all followup questions asking
about NameError exceptions will be answered
with "don't use nested classes", you probably
don't want to things this way.  as always, Python
works better if you use it to write Python code ;-)

</F>



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4