From: SourceForge.net <no...@so...> - 2011-10-19 14:45:10
|
Bugs item #3418113, was opened at 2011-10-04 01:35 Message generated for change (Comment added) made by ludov You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=957072&aid=3418113&group_id=196342 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Resolution: None Priority: 5 Private: No Submitted By: bernard paulus (bernardpaulus) >Assigned to: Ludovic Rousseau (ludov) Summary: Trivial reader comparison Initial Comment: Hi! I'm trying to build a shell to interact with smartcards above pyscard, and I had some strange results: reader=smartcard.reader.Reader.Reader('Brian Died For You') print reader == 42 Returns 1, i.e. True! And it's quite a problem at the moment, because i'm using a string to represent a null reader, which also compares as equal with every reader. By reading the source code, I found a small typo here: http://pyscard.sourceforge.net/epydoc/smartcard.reader.Reader-pysrc.html#Reader.__eq__ the current code is: 51 def __eq__(self, other): 52 """Returns 0 if self==other (same name).""" 53 if type(other) == type(self): 54 return self.name == other.name 55 else: 56 return 1 # here is the typo it should be: 51 def __eq__(self, other): 52 """Returns 0 if self==other (same name).""" 53 if type(other) == type(self): 54 return self.name == other.name 55 else: 56 return 0 # or False Besides that, thanks for this librairy! It's a pleasure to code in python with it :) Regards, bernard ---------------------------------------------------------------------- >Comment By: Ludovic Rousseau (ludov) Date: 2011-10-19 16:45 Message: Fixed in revision 574 http://pyscard.svn.sourceforge.net/viewvc/pyscard?view=revision&revision=574 Thanks ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=957072&aid=3418113&group_id=196342 |