Revision: 5032 Author: rotem Date: 2008-02-15 19:40:51 +0000 (Fri, 15 Feb 2008)
Log Message: ----------- Code style.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-02-15 19:35:20 UTC (rev 5031) +++ trunk/pywikipedia/wikipedia.py 2008-02-15 19:40:51 UTC (rev 5032) @@ -303,7 +303,7 @@
if site == None: site = getSite() - elif type(site) in [type(''), type(u'')]: + elif type(site) is string or type(site) is unicode: site = getSite(site)
self._site = site @@ -2593,7 +2593,7 @@ if self.site.lang == 'eo': pagenames = [encodeEsperantoX(pagetitle) for pagetitle in pagenames] pagenames = u'\r\n'.join(pagenames) - if type(pagenames) != type(u''): + if type(pagenames) is not unicode: output(u'Warning: xmlreader.WikipediaXMLHandler.getData() got non-unicode page names. Please report this.') print pagenames # convert Unicode string to the encoding used on that wiki @@ -2891,7 +2891,7 @@ }
# if we got a string, compile it as a regular expression - if type(old) == type('') or type(old) == type(u''): + if type(old) is string or type(old) is unicode: if caseInsensitive: old = re.compile(old, re.IGNORECASE | re.UNICODE) else: