A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/320481.html below:

Accessing class variable at class creation time

Accessing class variable at class creation time Accessing class variable at class creation timeSimon Percivall percivall at gmail.com
Fri Sep 23 18:23:46 EDT 2005
It might be that I'm complicating something easy here, but I
immediately thought of

import sys

class A:
    X = 2
    def F():
        f = sys._getframe().f_back
        print f.f_locals["X"]
    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