[Twisted-Python] Re: [Twisted-commits] *With() methods; refactor/rearrangement of various internal classes

Glyph Lefkowitz glyph at twistedmatrix.com
Thu Jan 30 23:54:57 MST 2003


On Fri, 31 Jan 2003 17:23:24 +1100, Andrew Bennetts <andrew-twisted at puzzling.org> wrote:
> > +        if isinstance(port, types.StringTypes):
>                                ^^^^^^^^^^^^^^^^^ This breaks Python 2.1
> 
> Should tcp.py import t.p.compat (ugh)?

I think not.  This has been the recommended style for a while.

    Python 2.1.3 (#1, Jan  3 2003, 13:08:57) 
    [GCC 2.95.4 20011002 (Debian prerelease)] on linux2
    Type "copyright", "credits" or "license" for more information.
    >>> import types
    >>> isinstance(1, types.StringType)
    0
    >>> isinstance(1, types.IntType)
    1

-- 
 |    <`'>    |  Glyph Lefkowitz: Travelling Sorcerer  |
 |   < _/ >   |  Lead Developer,  the Twisted project  |
 |  < ___/ >  |      http://www.twistedmatrix.com      |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20030131/fe2eaa1c/attachment.sig>


More information about the Twisted-Python mailing list