It works but I don't know whether it's formally inheritance or class
variable.

Before code was
    url = os.environ['HTTP_HOST'] if os.environ.get('HTTP_HOST') else
os.environ['SERVER_NAME']
    if url.find('niklas') > 0:

and now the change saves me from repeating myself!

util.py:
url = os.environ.get("HTTP_HOST", os.environ["SERVER_NAME"]) #declared
as class variable(?)

And viola just test if util.url.find('niklas') > 0:

Exactly what I wanted to do with your experienced guidance.

Many thanks
Happy refactored
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to