
Explore course: Write Pythonic Code Like a Seasoned Developer - mikeckennedy
https://training.talkpython.fm/courses/explore_pythonic_code/write-pythonic-code-like-a-seasoned-developer
======
wyldfire
Mr Kennedy -- this is an interesting course synopsis, it looks like you've put
a lot of good work into it. The course itself is not public access, but the
materials are.

> The few features that are Python 3 specific will be highlighted as such
> (e.g. new dictionary merging syntax).

The print statement=>function is a pretty big one too. IMO it's not too much
of a wart to import it from the future in order to straddle 2.x/3.x.

Anyone else who came hoping to read actual content on how to write more
Pythonic code should consult this popular reference from Pycon '07 [1].

[1]
[http://python.net/~goodger/projects/pycon/2007/idiomatic/han...](http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html)

~~~
mikeckennedy
Thanks so much. I do agree with you on the print statement to function,
although other than choosing python 3 vs 2 you don't have much control over
that.

As for the materials, good link. I'll be releasing 10 of the 50 topics as a
free video series outside the course over the next few weeks.

~~~
wyldfire
> other than choosing python 3 vs 2 you don't have much control over that.

But you do! Add "from __future__ import print_function" to your code and now
it can execute identically or near identically among python 2, 3. [1]

[1]
[https://docs.python.org/2/library/__future__.html](https://docs.python.org/2/library/__future__.html)

~~~
mikeckennedy
OK, true. :) But given the course is Python 3 it's moot in that scenario.

------
RodericDay
In the "Dictionary as a Switch Statement" example, how come the @staticmethod
decorator is on a different indent level than the method it wraps?

~~~
mikewhy
The class attributes are at the same indentation level. Seems like code that
wouldn't parse, which doesn't seem very Pythonic.

~~~
mikeckennedy
Whoops! I updated the graphic. But "programming" in PowerPoint is super tough
with the indentation. It always removes the extra spaces to be helpful. Thanks
for pointing it out.

~~~
Fuzzwah
Should:

    
    
        'n', Moves.Nort
    

Actually be:

    
    
        'n', Moves.North
    
    ?

~~~
mikeckennedy
That's not how your spell Nort? ;) Yes, thanks, updated.

------
kampsduac
Love the podcast. Will most definitely be using this to reinforce Python chops
when I need them this Fall.

~~~
mikeckennedy
Thanks so much. Glad you're enjoying Talk Python To Me!

------
limeyy
Would be good to add some of these typical code samples on that page. Good vs
bad.

