15,848 reputation
3176
bio website demianbrecht.github.com
location
age 37
visits member for 3 years, 11 months
seen 2 days ago

I've been spending over the last decade of my life building games.

I have a deeply seeded love of Python and the open source community as a whole.

Me elsewhere:


Mar
19
comment Preferred way to expand a command line script to be used as a library in Python
setuptools is the canonical packaging method for Python applications. After having used it myself, I much prefer it to loose files with if __name__ == '__main__' handlers. For example: github.com/Demonware/jose/blob/master/setup.py#L63, github.com/Demonware/jose/blob/master/jose.py#L540. The first link demonstrates the entry points in a library that I wrote and the second shows the implementation. Note that argument parsing is still entirely valid within the callable.
Mar
19
comment Aggregate documentation comments from multiple scripts into README?
In my experience, Sphinx tends to be much more commonly used and can pull docs from docstrings as well using the autodoc feature (sphinx-doc.org/ext/autodoc.html).
Mar
19
comment Does sending system-profile information with HTTP GET request conform to RESTful practices?
"If the framework is useful and this is the way it provides profile information to the backend, the REST police aren't going to break down your door." +1.
Mar
19
comment Best way to analyse a large class before refactoring it into smaller classes?
Interesting, why the downvote?
Mar
18
revised Preferred way to expand a command line script to be used as a library in Python
added 321 characters in body
Mar
18
answered Preferred way to expand a command line script to be used as a library in Python
Mar
18
comment Write two versions of class with two different super classes without violating DRY?
+1 for LSP, composition rather than inheritance.
Mar
18
revised Does sending system-profile information with HTTP GET request conform to RESTful practices?
added 347 characters in body
Mar
18
comment Best way to analyse a large class before refactoring it into smaller classes?
@sydan: Are you able to mock the interaction with other classes? I know this is easier in some languages than others. If that's a no-go, perhaps system tests to get started?
Mar
18
revised Does sending system-profile information with HTTP GET request conform to RESTful practices?
edited body
Mar
18
comment Does sending system-profile information with HTTP GET request conform to RESTful practices?
@MikePartridge: Derp, typo. It's RFC 7231. Thanks for the catch.
Mar
18
answered Does sending system-profile information with HTTP GET request conform to RESTful practices?
Mar
18
answered Best way to analyse a large class before refactoring it into smaller classes?
Jan
21
awarded  Nice Answer
Sep
24
awarded  Autobiographer
Sep
1
answered Is randomly refactoring code allowed in scrum
Jul
2
awarded  Curious
Apr
26
awarded  Yearling
Mar
29
awarded  Good Question
Nov
30
awarded  Good Answer