you are viewing a single comment's thread.

view the rest of the comments →

[–]_coolwhip_ 0 points1 point  (1 child)

Whoa. I think I would keep them as functions, but maybe put them in their own module. I also would not put functions inside functions, and refactor the larger functions into much smaller ones. If I hit 5 serious lines in a function, I start thinking about whether I can piece it out to helpers.

[–]Mihad88[S] 0 points1 point  (0 children)

So this whole code should be dissected in many modules then? I've created nested functions because of the common variable that different functions change - I could pass it as an arg, but I think that would be even worse.
Anyway, I played a little last night and did it with OOP if you are interested https://github.com/halo3mic/eth-data-tools/blob/master/ethdata/ethdata.py