[Zope3-Users] "boolean" value of adapted objects

Thierry Florac thierry.florac at onf.fr
Tue Apr 3 06:46:25 EDT 2007


  Hi,

I have a little question about "boolean" values of adapted objects.
For example, I had the following code :

	info = ISharedDataInfo(context, None) or \
	       IPrivateDataInfo(context, None)
	if info is not None:
	    return context
	return None

Even if "context" is correctly adapted to the first interface, the
boolean value matching the adapted object is not always True ; in these
cases, the second test is done, and the global result is set to "None"
instead of "context".

Of course, it's easy to modify this code with two tests instead of one,
but I'm sure there's an easy way to handle such things, so any
information would be really great !!

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : thierry.florac at onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85



More information about the Zope3-users mailing list