Post
Topic
Board Development & Technical Discussion
Re: [Solved] Programming Bitcoin , Jimmy Song. ecc.py functions aren't working
by
SamYezi
on 21/01/2022, 18:00:37 UTC
I see you solved your issue, however there was one thing I want to point out.
The Python error messages actually tell you a lot about what's going wrong, to the point where I could figure out some of the issues completely statically. One example is where it's telling you that the function __add__ is not defined. We can see in your code that your indents are all over the place, putting the __add__ function within the __ne__ function, so it's invisible (nonexistent) from the outside.
Quote
To be safe I copied and pasted functions from answers.py into ecc.py . The problem still persists
Picture 1: https://i.stack.imgur.com/Cihsv.jpg
Picture 2: https://i.stack.imgur.com/tlIig.jpg
Picture 3: https://i.stack.imgur.com/gQHf9.jpg

Also here, it directly tells you your indent is off and you seem just not to read these error messages. They exist for a reason.
Quote

I think that Jimmy Song here wanted to make readers implement everything in a TDD way, which is a very good idea and teaches learners a lot about the language itself and how to develop cleanly. You make use of the test framework by writing tests beforehand according to spec / concept, then develop until your tests are all 'green'.



Also, it's actually a rule here not to write consecutive posts, but merging them instead, by the way.
32. Posting multiple posts in a row (excluding bumps and reserved posts by the thread starter) is not allowed.


Thank you for the tip!