Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
4
Newest
 Student
Impact
~12k people reached

  • 0 posts edited
  • 0 helpful flags
  • 6 votes cast
Nov
9
comment How to deal with database connections in a Python library module
define avoid? Self is what defines that as an instance method, rather than a class method. I guess you could create the database as a static property on the class, and then only use class methods (no self needed anywhere), but then the database would be global to the class, not just the individual instantiation of it.
Jun
5
answered How to deal with database connections in a Python library module
May
12
awarded  Student
May
12
comment Fundamental TDD: stuck with writing a test so I can write code that I want
Other than at construction time, I do not plan on allowing items to be added to this list. This is for an API Wrapper so I'm mostly doing a 1:1 with some XML to custom objects. But I get where you're going. Maybe I'll add an addGame(x : Game) method, mock it out, and ensure it was called as many times as I expected. Do you think that is "testing" it enough, or am I mocking the piece that I'm testing?
May
12
comment Fundamental TDD: stuck with writing a test so I can write code that I want
@WinstonEwert This is data returned from a REST API serving XML. I downloaded the Season endpoint locally to use as sample data.
May
12
asked Fundamental TDD: stuck with writing a test so I can write code that I want
May
10
awarded  Supporter
May
9
awarded  Editor
May
9
revised Where should I store the files for python modules I install?
Removed request for help to add a link to virtualenv, since I added it in the previous edit.
May
9
comment Where should I store the files for python modules I install?
Wow! That's surprising. You happened to find the one package that wasn't part of PyPi :P I was trying to say that with virtualenv setup, your "install directory" would be C:\path_to_your_virtualenv\lib\python<x.y>\site-packages . setup.py should take this into account, and also install there. Sorry, my answer was a little unclear there. I'll update it.
May
9
awarded  Teacher
May
9
answered Where should I store the files for python modules I install?