Got this in an email.
"Python's multi-threading module seems not efficient because of the global interpreter lock?"
Yep.
Is the trick is to use "Thread-Local Data"?
Nope.
Interestingly, there was no further ask. The questioner had decided on thread-local data because the questioner had decided to focus …
https://sobolevn.me/2019/02/python-exceptions-considered-an-antipattern While eloquent and thorough, I remain unconvinced that this is a significant improvement over try/except. It's common enough in some functional languages to have strong support and a long, successful history. I think it replaces one problem with another. It's not a "solution …
more ...Consider the following code
def max(m: int, n: int) -> int:
if m >= n:
return m
elif n >= m:
return n
else:
raise Exception(f"Design Error: {vars()}")
There's a question about else: clause and the exception raised there.
See this
Dear Pythonista lazyweb: If I have a property spam and the attribute that backs it is _spam, what do we call that? The "backing attribute"? The "original property"? Something else? Is there an official term for this?
—Al Sweigart (@AlSweigart) January 29, 2019
My answer was -- frankly -- vague …
more ...Today's Example of Starting Badly: Building HTML.
The code has a super-simple email message with f"<html><body><p>stuff {data}</p></body></html>". It was jammed into an email object along with the text version. All very nice. For a moment, I considered suggesting that f-string substitution wasn't a …
more ...I can't actually share all the code. So this feels incomplete. But I can share what I said about the code. Then you can look at your code and decide if you've got similar problems to fix.
My responses were these. I'll expand on them below.
See 10 Reasons to Learn Python in 2019.
I want to dwell on #4 for a moment.
The Python community actually has a Code of Conduct. We try to stick by it and conferences will have reporting mechanisms in place so we can educate folks who are being inconsiderate or …
more ...There are patterns to bad writing. I'll give some examples based on a blog post I was sent. It's also based -- indirectly -- on some of proposals I saw for PyCon and PyDataDC.
For the conference calls for papers, I can ask a few questions of the author, but that's about …
more ...Videos are up from PyDataDC 2018. See all the PyData talks at PyDataTV on YouTube.
more ...