Resources/pointers for writing maintable, testable Python

2016-05-18 Thread Jacob Scott
Many years ago, when I was primarily writing Java, I found Misko
Hevery's Guide:
Writing Testable Code
 to
be incredibly helpful in guiding the design and structure of my codebase,
and as reference for checking if my code was smelly.

Today, I'm happily writing primarily Python (unfortunately, 2.7 -- but I'm
not sure it makes that much of a difference), but I haven't found anything
that speaks to me in the same way. Some of the best resources I've found,
but which don't quite cover all of what I'm looking for, include

   - PEP-8 and PEP-20
   - The Hitchhiker's Guide to Python
   
   - Effective Python 

I'd appreciate any pointers to resources I might have missed, general
thoughts on the topic, etc.

Thanks,

Jacob
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Resources/pointers for writing maintable, testable Python

2016-05-18 Thread Jacob Scott
Ah, what I should have done is note that I am writing Python 2.7 (and this
is at work, with all that entails...), but am happy to take advice that
applies only to Python 3 (even 3.5 or 3.6.0a1!) and work backwards to apply
it to Python 2.7.

I think I would be (perhaps pleasantly) surprised if there was a wide gulf
between Python 2.7 and Python 3 *in terms of advice/resources applicable to
my original question*. Based on my (admittedly shallow) understanding of
overall Python 2.7/3 differences, the biggest changes (from e.g.
http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html) tend to
be a bit lower level (utf-8 str) than what I'm focused on (maintainable and
testable classes, functions, modules, etc).

Thanks for the pointer to Code Like A Pythonista and the feedback on 2.7 vs
3!

Jacob

On Wed, May 18, 2016 at 5:55 PM, Ben Finney 
wrote:

> Jacob Scott  writes:
>
> > Today, I'm happily writing primarily Python (unfortunately, 2.7 -- but
> I'm
> > not sure it makes that much of a difference)
>
> Python 2.7 is still viable, but is certainly a dead end. The difference
> increases month by month, and the advantage is only going to increase to
> Python 3.
>
> Any new code base should not be written in Python 2. Any libraries you
> need which don't work yet on Python 3 should be seriously reconsidered.
>
> > I'd appreciate any pointers to resources I might have missed, general
> > thoughts on the topic, etc.
>
> Code Like A Pythonista was written in the Python 2 era
> <http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html>
> but is still excellent advice today.
>
> --
>  \ “I have the simplest tastes. I am always satisfied with the |
>   `\best.” —Oscar Wilde, quoted in _Chicago Brothers of the Book_, |
> _o__) 1917 |
> Ben Finney
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Resources/pointers for writing maintable, testable Python

2016-05-19 Thread Jacob Scott
Indeed, I skimmed the TOC for Test-Driven Development with Python and it
does look to be rather Django-centric (which makes it a bit less helpful to
me). I will take a look at "Testing Python: Applying Unit Testing, TDD, BDD
and Acceptance Testing"!

Thanks,

Jacob

On Thu, May 19, 2016 at 8:33 AM, Mike Driscoll  wrote:

> On Wednesday, May 18, 2016 at 4:48:28 PM UTC-5, Andrew Farrell wrote:
> > Hi Jacob,
> >
> > You are probably looking for the book Test-Driven Development with Python
> > .
> > You'll also want to look at py.test 
> >
> > Cheers!
> > Andrew Farrell
>
> I was under the impression that this book is primarily aimed at
> Python/Django web testing. I saw "Testing Python: Applying Unit Testing,
> TDD, BDD and Acceptance Testing" is getting good reviews too though.
>
> Mike
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list