[Tutor] Re: test <type 'DbiDate'>

Derrick 'dman' Hudson dman@dman.ddts.net
Mon Feb 3 11:44:02 2003


--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Feb 03, 2003 at 04:53:09PM +0100, janos.juhasz@VELUX.com wrote:
| Dear All,
|=20
| how can I test if an object is <type 'DbiDate'> or not ?

if isinstance( obj , DbiDate ) :
    print "It is a DbiDate"
else:
    print "It is not a DbiDate, it is %s" % str(obj.__class__)


It isn't quite as straight forward (but it might be) in python < 2.2.
Let us know if you are using an old python.

-D

--=20
Consider what God has done:
    Who can straighten what He has made crooked?
        Ecclesiastes 7:13
=20
http://dman.ddts.net/~dman/

--0OAP2g/MAC+5xKAE
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj4+nC4ACgkQO8l8XBKTpRR0VgCeKWIp+cAVtx4VVP4QtK3K1eof
Xy0AoLMV5XVEeEB0Mo+UEalteVXgNYl5
=8m6c
-----END PGP SIGNATURE-----

--0OAP2g/MAC+5xKAE--