Trying to use this bit of code in a Python script: if not hasattr(context.REQUEST,'learners') I get a a KeyError for for learners. Am I missing something, because this is exactly what hasattr is supposed to be used for. -- Bryan C. Andregg Duke University Medical Center Programmer Dept. of Anesthesiology e <bryan.andregg@duke.edu> p +1 919 684 6201
Hello Bryan, Thursday, August 8, 2002, 9:35:26 PM, you wrote: BCA> Trying to use this bit of code in a Python script: BCA> if not hasattr(context.REQUEST,'learners') BCA> I get a a KeyError for for learners. Am I missing something, because this is BCA> exactly what hasattr is supposed to be used for. try context.REQUEST.has_key('learners') instead REQUEST is a lot like a dictionary.. :) -- Geir Bækholt web-developer geirh@funcom.com funcom oslo | webdev-team
participants (2)
-
Bryan C. Andregg -
Geir Bækholt