

Things you didn't know about Python - d0ugal
https://speakerdeck.com/u/mitsuhiko/p/didntknow

======
Permit
Do these postings of slides ever help anyone? I never seem to get anything out
of just clicking through slides with no explanations. It's essentially reading
20 unjustified bullet points to me.

~~~
davidjohnstone
I agree. The problem is that modern slide design says that slides shouldn't be
done in a way that lets them work independently of the presentation. That is,
slides are there to provide structure and illustrate things that are difficult
to describe verbally, but aren't meant to repeat what the presenter is saying.

It would be very nice if these online slide presentations came with the
speaker's notes that actually cover the main points of what they're saying
(with explanation). This assumes that these notes exist, but I feel that the
slides by themselves are not very valuable.

(No disrespect meant to Armin Ronacher — I use his work every day and I'm a
big fan of what he's done for the Python community.)

~~~
scott_s
That would be more of an essay - which would certainly be valuable, but takes
a considerable amount of time.

------
xi
Armin's implementation of `cached_property` is not entirely correct. Well, it
works, but the branch where `value` is not `missing` is never executed: the
object's `__dict__` takes precedence over the descriptor _as long as the
descriptor does not define `__set__` method_.

Here is an implementation of `cached_property` I use:

    
    
        class cached_property(object):
    
            def __init__(self, fget):
                self.fget = fget
                self.__name__ = fget.__name__
                self.__module__ = fget.__module__
                self.__doc__ = fget.__doc__
    
            def __get__(self, obj, objtype=None):
                if obj is None:
                    return self
                value = self.fget(obj)
                # For a non-data descriptor (`__set__` is not defined),
                # `__dict__` takes precedence.
                obj.__dict__[self.__name__] = value
                return value

~~~
the_mitsuhiko
Don't do this. Your implementation does not work if someone invokes the
dscriptor's __get__ by hand which is not uncommon. My implementation takes the
shortcut but also still does the correct thing if you keep a reference to the
property object.

------
cobychapple
Best slide for me was "worry less & get stuff done". Good advice.

------
timkeller
Saw the talk in-person at Pycon South Africa this morning. Excellent
presentation - thanks Armin.

~~~
krat0sprakhar
Is there a video of this talk somewhere?

~~~
simondlr
The talks are being recorded. They should be online later. Great talk from
Armin!

------
andrewcooke
some context for slide 99? (which says "screw HN")

~~~
zalew
on HN every technology older than a week who isn't posted by very vocal 19
year old fans at least 4 times per day is 'dying'.

~~~
ElliotH
Can we please try and avoid the casual ageism? I'm 20 and I don't recognise my
19 year old self in that description. Further I know many people of all sorts
of ages who switch to the latest 'cool' technology at the first opportunity.

~~~
opiumden
The poster didn't say "every 19 year old is a vocal fan boy who posts 4 times
a day"

The poster said that there are some 19 year olds who are very vocal about
their fanaticism and who post 4 times a day.

It's not ageism because it's not generalized to an entire group of people. So
if you don't recognize yourself in the comment, it's not aimed at you. Stop
being hyper-defensive.

~~~
0x006A
To imply being 19 or age in general has anything to do with being vocal or a
fan is agism. What makes zalew believe those posts where made by 19 year olds?
Last time I checked, HN did not require age verification or disclosed such
information about its members.

~~~
dguaraglia
Or maybe, just maybe, he was being sarcastic and not ageist? God, why do
people need to take everything at face value...

~~~
masterzora
I agree with you for this particular case but you are mistaken if you think
that sarcastic and _ist are mutually exclusive. Sarcastic comments of a_ ist
form can (and nontrivially often do): mask sincere _ism; be a more socially-
acceptable-looking way of expressing actual_ ism; encourage _ism, especially
of a casual degree; exhibit societal/subconscious/not-actively-malicious_ ism;
or create a generally hostile environment for people of an oppressed class of
*.

So, yeah, probably an overreaction for this particular occasion, but it's not
so easy as writing it off as "sarcasm".

------
tripzilch
It looks very interesting, but I feel I'm missing half by seeing just the
slides. Is there a video of this talk somewhere?

~~~
tripzilch
Hm, I see on the schedule page of PyCon-ZA that the talk was only this
morning? (or night, depending on your time zones) So I can imagine that _if_
there'll be a video available, we'll have to wait for it :)

------
foxhop
If you are interested in learning more about python and caching I wrote a post
about it couple days ago:

<http://russell.ballestrini.net/explaining-cache-with-python/>

~~~
AncientPC
That's more accurately described as memoization, as caching is a broader term.

Also, you might want to look into Sieve of Eratosthenes, as you only have to
test up to sqrt(n) for primality:
<https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes>

~~~
foxhop
Thank you, AncientPC. I have adjusted the article with the insight you and
many others have provided me.

------
pinchyfingers
I have a ton of respect for Armin. Can't wait for this video to be posted.

------
ronreiter
I especially liked the last slide :)

