[Spambayes-checkins] spambayes/spambayes ProxyUI.py, 1.50, 1.51 classifier.py, 1.27, 1.28 tokenizer.py, 1.32, 1.33

Tony Meyer anadelonbrin at users.sourceforge.net
Fri Oct 29 02:14:45 CEST 2004


Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16988/spambayes

Modified Files:
	ProxyUI.py classifier.py tokenizer.py 
Log Message:
As I understand it, this gives Python 2.4 users a free speedup.

If possible, use the builtin (faster, C-implemented) set class, falling back to sets.Set,
 then back to our compatsets.Set

Index: ProxyUI.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** ProxyUI.py	12 Oct 2004 23:44:00 -0000	1.50
--- ProxyUI.py	29 Oct 2004 00:14:42 -0000	1.51
***************
*** 61,67 ****
  
  try:
!     from sets import Set
! except ImportError:
!     from compatsets import Set
  
  import tokenizer
--- 61,74 ----
  
  try:
!     # We have three possibilities for Set:
!     #  (a) With Python 2.2 and earlier, we use our compatsets class
!     #  (b) With Python 2.3, we use the sets.Set class
!     #  (c) With Python 2.4 and later, we use the builtin set class
!     Set = set
! except NameError:
!     try:
!         from sets import Set
!     except ImportError:
!         from spambayes.compatsets import Set
  
  import tokenizer

Index: classifier.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/classifier.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** classifier.py	20 Oct 2004 22:09:01 -0000	1.27
--- classifier.py	29 Oct 2004 00:14:42 -0000	1.28
***************
*** 41,47 ****
  import types
  try:
!     from sets import Set
! except ImportError:
!     from spambayes.compatsets import Set
  
  # XXX At time of writing, these are only necessary for the
--- 41,54 ----
  import types
  try:
!     # We have three possibilities for Set:
!     #  (a) With Python 2.2 and earlier, we use our compatsets class
!     #  (b) With Python 2.3, we use the sets.Set class
!     #  (c) With Python 2.4 and later, we use the builtin set class
!     Set = set
! except NameError:
!     try:
!         from sets import Set
!     except ImportError:
!         from spambayes.compatsets import Set
  
  # XXX At time of writing, these are only necessary for the

Index: tokenizer.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/tokenizer.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** tokenizer.py	5 Aug 2004 00:56:53 -0000	1.32
--- tokenizer.py	29 Oct 2004 00:14:42 -0000	1.33
***************
*** 17,23 ****
  import urllib
  try:
!     from sets import Set
! except ImportError:
!     from compatsets import Set
  
  from spambayes import classifier
--- 17,30 ----
  import urllib
  try:
!     # We have three possibilities for Set:
!     #  (a) With Python 2.2 and earlier, we use our compatsets class
!     #  (b) With Python 2.3, we use the sets.Set class
!     #  (c) With Python 2.4 and later, we use the builtin set class
!     Set = set
! except NameError:
!     try:
!         from sets import Set
!     except ImportError:
!         from spambayes.compatsets import Set
  
  from spambayes import classifier



More information about the Spambayes-checkins mailing list