[Twisted-Python] Re: [Twisted-commits] *With() methods; refactor/rearrangement of various internal classes
Jp Calderone
exarkun at intarweb.us
Fri Jan 31 20:40:51 MST 2003
On Fri, Jan 31, 2003 at 06:30:06PM +1100, Andrew Bennetts wrote:
> On Fri, Jan 31, 2003 at 12:54:57AM -0600, Glyph Lefkowitz wrote:
> > 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
>
> Yes, but now try types.StringType*s*, as used in the code.
>
Yea, thanks. Fix has been checked in. (Not only is StringTypes not in
2.1, but isinstance() doesn't work on tuples there either ;)
Jp
--
C/C++/Java/Perl/Python/Smalltalk/PHP/ASP/XML/Linux (User+Admin)
Genetic Algorithms/Genetic Programming/Neural Networks
Networking/Multithreading/Legacy Code Maintenance/OpenGL
See my complete resume at http://intarweb.us:8080/
--
up 46 days, 7:49, 5 users, load average: 0.55, 0.34, 0.16
-------------- 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/6c8b2838/attachment.sig>
More information about the Twisted-Python
mailing list