--On 9. Mai 2006 11:18:25 -0400 Jonathan <dev101@magma.ca> wrote:
I have a short python script:
gc = context.restrictedTraverse('coup/temp_folder/GarbageCollector', None) print 'gc=',str(gc) if gc: print 'GarbageCollector exists' else: print 'No GarbageCollector'
which, when run produces:
Check the implementation. "if obj" calls obj.__nonzero__() or obj.__len__().. depending on the implemenation this will explain the result
When the script is changed to:
gc = context.restrictedTraverse('coup/temp_folder/GarbageCollector', None) print 'gc=',str(gc) if gc is not None: print 'GarbageCollector exists' else: print 'No GarbageCollector'
This is the right way to do it. -aj -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376 E-Publishing, Python, Zope & Plone development, Consulting