[Zope] Re: Finding an object in a folder
Tres Seaver
tseaver at palladion.com
Fri May 27 08:15:05 EDT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Paul Winkler wrote:
> On Fri, May 27, 2005 at 08:51:58AM +0100, Chris Withers wrote:
>
>>Paul Winkler wrote:
>>
>>
>>>marker = ()
>>>if getattr(some_object, marker) is not marker:
>>
>>For good measure, I wonder if that should be a [], no a ()?
>
>
> What's wrong with a tuple? There's no reason to mutate the marker.
In Python, there is only empty tuple object, while each empty list is a
distinct object. For use as a marker, the empty list can't return a
false positive, while the empty tuple can.
Tres.
- --
===================================================================
Tres Seaver tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFClw9J+gerLs4ltQ4RAtyCAJ4y+h+rDtSmo+Sa2n5K+h87z/24DwCgwBFY
9Wrhk9aGMBUPm1DxsOpewec=
=O5re
-----END PGP SIGNATURE-----
More information about the Zope
mailing list