

Idiomatic Python [video] - pearkes
https://www.neckbeardrepublic.com/screencasts/idiomatic-python

======
rodly
I wish C++ had a isMember method for its containers or a keyword like Python's
"in". The most succinct way to do this currently (with vector for instance)

vector<string> naughtyList {"Bob", "Tom", "Rod", "God"}; string member =
"Jerry"; for (string & each : naughtyList) if (member == each) // do stuff

/rant

~~~
benhoyt
I'm not sure why "find" or "contains" isn't a member function of STL container
types, but there is the std::find() function:

    
    
       bool xIsMember = std::find(v.begin(), v.end(), x) != v.end();
    

Edit: I admit this is terrible API design. When you want the v.begin()/v.end()
combination 90% of the time, why not at least have a std::find() overload that
does that for you? Or simply add "std::contains(v, x) -> bool"? You can write
your own version of that, of course, but... my take-home point: API design is
very important.

~~~
awnird
Providing container operations as functions in <algorithm> operating on
iterators means that someone implementing a new container with iterators
immediately has a wealth of functionality available with no extra effort.

Also, containers that are most well suited to membership searches (std::set
and std::multiset) do include find(Key const& key) as a member.

------
ljos
I was just wondering, shouldn't it be python3 and not python2 when talking
about idiomatic python now adays?

~~~
famousactress
That'll make sense just as soon as it's idiomatic to write python 3 :)

~~~
pekk
Python 3 is not new, and it's not Perl 6.

------
dfbrown
It would be nice if you resized your editor window to be as small as possible
and cropped the video to that size. As it is the area of the video I actually
care about is very small with lots of empty space around it.

------
myko
Side note: the video player is really annoying, hitting the 'full screen'
button uses the terrible full screen functionality of OS X rendering my second
monitor useless.

~~~
danjessen
atleast it seams to load on your screen

~~~
googletron
If you provide me with some information, I can definitely fix the issue for
you.

What browser are you using? what version? What operating system are you using?

~~~
japaget
Same problems here, get audio only:

Windows 7 Professional x64 SP1. No video on the following 3 browsers: Firefox
19.0.2, Chrome 25.0.1.1364.172, and Cyberfox 19.0.2 (a 64-bit build of
Firefox). I get video, but the audio is choppy on IE 9.

It seems to work on my iPhone with Safari (iOS 6.1.2) but the bandwidth
required is too great for my 4G connection.

------
alienreborn
Related: [http://www.jeffknupp.com/blog/2012/10/04/writing-
idiomatic-p...](http://www.jeffknupp.com/blog/2012/10/04/writing-idiomatic-
python/)

------
tmrhmd
I liked your website and was going to sign up. However, your catalog of screen
casts is too short to sign up for at the moment. On the other hand, does
anyone know other python screen cast websites like this with more
topics/videos?

~~~
googletron
I am creating new content every week. I am also going to be creating content
at a rate faster than one per week, to combat this exact complaint.

So see ya in 4 months?

~~~
tmrhmd
I'm in!

------
hrayr
Off Topic: Looks like he's using tmux in the terminal, but does anyone know
how he made the bottom panels look so awesome?

~~~
influx
Looks like: <https://github.com/erikw/tmux-powerline>

See also:

<https://github.com/Lokaltog/vim-powerline> and *-powerline for shells, etc.

