python - class definition dependence on runtime -


in webapp made 2 different sessionhandler classes inheriting class called sessionhandler

now i'd initiate appropriate handler (dependent on cookie value.)

background: sessionhandler should base class of controller needs call controller backend method otherwise assign handler object ctrl member

is there way set superclass @ runtime?

or other way solve that? hope got meant!

i not sure entirely understood question, sure need use inheritance? couldn't class need member instead?

changing superclass @ runtime not sound design, if @ possible.

just sure got you, want have controller inherit 1 of sessionhandlers, select 1 @ runtime? rather make controller have member variable of type sessionhandler.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -