primal100 / pybitcointools

Simple, common-sense Bitcoin-themed Python ECC library
Other
335 stars 151 forks source link

Bug on rpc.py #22

Closed iRhonin closed 2 years ago

iRhonin commented 6 years ago

I think this two line is obviously incorrect in rpc.py file (line 97 and 100):

        if self.use_ssl and not 's' in server.keys():
        elif not self.use_ssl and not 't' in server.keys():
Aareon commented 6 years ago
>>> l = ['l', 'm', 'n']
>>> if True and not 's' in l:
...          print('works')
...
works
>>> not 's' in l
True

How are the above two lines incorrect?

mehrdad1373pedramfar commented 6 years ago

Actually it is not incorrect but the best practice is to write 's' not in l instead of not 's' in l.

Aareon commented 6 years ago

Unrelated as this issue isn’t about best practice. OP opened this as a bug. However, this is not a bug.

primal100 commented 6 years ago

Never knew about that being best practice. Both work anyway. I'm working on a rewrite of this in another branch so will have a look at it their.

iRhonin commented 2 years ago

Yeap both are the same.