As part of my series on Python's syntactic sugar, I am going to cover the for statement. As usual, I will be diving into CPython's C code, but understanding or even reading those parts of this post won't be required in order to understand how the unravelling works. The bytecodeLe … | Continue reading
In this post, as part of my series on Python's syntactic sugar, I'm going to cover assert statements. Now, the actual unravelling of the syntax for assert a, b is already given to us by the language reference: if __debug__: if not a: raise AssertionError(b)Implementat … | Continue reading
As part of my series on Python's syntactic sugar, I am going to cover import statements. This will include delving into the quirky interface of __import__()(although in actual code you should use importlib.import_module()). What this post will not cover, though, is how imports wo … | Continue reading
As part of my series on Python's syntactic sugar, I am going to cover boolean operations: a or b and a and b. The semanticsA key thing to know about or and and is that they short-circuit. What that means is that if just the first argument is enough to | Continue reading
This post in my series on Python's syntactic sugar, I am going to cover membership testing: in and not in. As the language reference says, "the operators in and not in test for membership". In other words, in and not in are used to check if an object is contained | Continue reading
For this next blog post in my series of Python's syntactic sugar, I'm tackling what would seem to be a very simple bit of syntax, but which actually requires diving into multiple layers to fully implement: not. On the surface, the definition of not is very straightforward: The op … | Continue reading
As part of this blog series on Python's syntactic sugar, I said in the post on unary arithmetic operators that it might be the most boring post in this series. I think I was wrong. 😄 The operators is and is not are very short. The documentation for the operators says | Continue reading
For the next part of my blog series on pulling apart Python's syntactic sugar, I'm going to be tackling rich comparison operators: ==, !=, >, <, >=, <=. For this post I am going to be picking apart the example of a > b. Looking at the bytecodeUsing the dis module, … | Continue reading
In this entire blog series on Python's syntactic sugar, this might end up being the most boring post. 😄 We will cover the unary arithmetic operators: -, +, and ~ (inversion if you don't happen to be familiar with that last operator). Due to the fact that there is only a s … | Continue reading
PrologueThis post is part of a series on Python's syntactic sugar. The latest source code can be found as part of the desugar project. IntroductionPython has something called augmented arithmetic assignment. If you're not familiar with that phrase, it's basically when you do some … | Continue reading
I have been actively programming in Python for nearly 13 years, ten of which have been spent as a core developer of the language itself. You could say I have an opinion when it comes to programming languages. That I have taken sides. That I am a programming language bigot. | Continue reading
The reaction to my blog post on unravelling attribute access was positive enough that I'm inspired to do another post on how much of Python's syntax is actually just syntactic sugar. In this post I want to tackle binary arithmetic operations. Specifically, I want to unravel how s … | Continue reading
I wonder how many people realize that Python is has a lot of syntactic sugar? I'm not claiming it's like a Lisp-based language where the syntax is as bare bones as possible (although the Lisp comparison is not entirely unfounded), but much of Python's syntax isn't technically nee … | Continue reading
On October 1, 2016, I stopped volunteering for open source projects -- including Python -- for a month. While I still did open source work for Python as part of my job, I spent absolutely zero time helping any project outside of work (so no evenings, no weekends). This was | Continue reading
Why ask this question?It's no secret that I want a Python implementation for WebAssembly. It would not only get Python into the browser, but with the fact that both iOS and Android support running JavaScript as part of an app it would also get Python on to mobile. That | Continue reading
Back in 2017 I wrote a blog post on how I manage version numbers. In that post I mentioned how I tried to follow semantic versioning. Over the subsequent 3 years I have come to the conclusion I actually don't like SemVer for my projects. It turns out I am | Continue reading
For the Python extension for VS Code, I wrote a simple script for generating our changelog (think Towncrier, but simpler, Markdown-specific, and tailored to our needs). As part of our release process we have a step where you are supposed to run python news which points Python at … | Continue reading
I am going to admit upfront that this is a thought piece, a brain dump, me thinking out loud. Do not assume there is a lesson here, nor some goal I have in mind. No, this blog post is providing me a place to write out what tools I use | Continue reading
Recently on Twitter there was a maintainer of a Python project who had a couple of bugs filed against their project due to builds failing (this particular project doesn't provide wheels, only sdists). Eventually it came out that the project was using a pyproject.toml file because … | Continue reading
When people start learning Python, they often will come across a package they want to try and it will usually start with "just pip install it!" The problem with that advice is it's a very simplistic view of how to manage packages and can actually lead to problems down the | Continue reading
Fellow core developer and Canadian, Mariatta [https://twitter.com/mariatta],asked on Twitter about python -m pip and who told her about that idiom alongwith asking for a reference explaining it:> I learned sometime ago that we should be doing`python -m pip install ...` instead of … | Continue reading
Someone emailed the steering council recently to ask what it was like to be onit, presumably because nominations will be opening next month[https://mail.python.org/archives/list/python-committers@python.org/thread/PLDUMAJOLHM5W6FWOMSGUBN2Q7Z6D3JM/]. Instead of sending a private r … | Continue reading
On September 10, 2019 while I was in London, UK at the Python core dev sprints,I got a message from a user named "spacedrop" [https://keybase.io/spacedrop] on Keybase [https://keybase.io/]. The message said I was being given 356.2904939XLM as a surprise gift of "free Lumens worth … | Continue reading
A co-worker of mine attended a technical talk about how Go's module mirror[https://proxy.golang.org/] works and he asked me whether there was somethingthere that Python should do.> Best technical talk that I've seen in a long time: @katie_hockman[https://twitter.com/katie_hockman … | Continue reading
Over the past two months I have given two podcast interviews where I talk abouthow we handled Guido's retirement, chose our new governance model, and whatbeing on the inaugural steering council has been like.Now that I have "talked it out" at least twice I don't plan to blog abou … | Continue reading
If you have ever looked at a project that has a lot of wheels[https://www.python.org/dev/peps/pep-0427/] (like numpy[https://pypi.org/project/numpy/#files]), you may have wondered what the partthat comes after the project name and version mean. Well, they are known as platform … | Continue reading
On April 30, 2018, https://xkcd.com/1987/ got published. This wasn't the firsttime that Randall Munroe posted about Python (probably the most famous comic washis import antigravity one [https://xkcd.com/353/] which became an actualmodule in the stdlib as an easter egg), but it … | Continue reading
This post is meant to act as a summary of the current state of Python's governance as of the end of 2018. If you want to see an alternative take on what I present here, LWN has an article. What did Guido provide us? When discussing how the Python project | Continue reading
(If you would prefer to watch a 30 minute talk on this same content, you can watch my Python US 2018 keynote) Who am I? [1] To start, I want to provide my bonafides so you know I'm not some crank spouting some armchair advice with nothing to back up | Continue reading
[Please note that the code in this blog post is now up on PyPI as part of the modutil library [https://pypi.org/project/modutil/]]One of the new features in Python 3.7[https://docs.python.org/3.7/whatsnew/3.7.html] is PEP 562[https://www.python.org/dev/peps/pep-0562/] which add … | Continue reading
There was a question at work about what the most popular Docker container imagefor running Python code was? I didn't have an answer, so I asked on Twitter tosee if a clear answer could be gleaned.The first poll [https://twitter.com/brettsky/status/925402634378395648] askedwhat p … | Continue reading
On Wednesday, October 25th, I gave a workshop at PyLadies Vancouver[http://www.pyladies.com/locations/vancouver/] on how to package up your codeand put it up on PyPI [https://pypi.org/]. Since this workshop came about byrequest, I figured others out there who couldn't attend mig … | Continue reading
I recently helped someone release their first project on PyPI and I was askedwhy I did version numbers the way I did, so I figured I would share where mycurrent thinking on the topic sits (this doesn't mean all of my projectscurrently follow this as my thoughts on this have chang … | Continue reading
[This was meant to be a contribution to a book collecting chapters on varioustopics that would help "a programmer who has never been politically active, butis starting to wonder why so many things seem to be going from bad to worse".Unfortunately the book has fallen through, so I … | Continue reading
To gain commit rights on CPython, a pre-existing core developer nominates yourfor commit rights to python-committers. That nominator lays out roughly why youshould be given commit rights, and then promises to watch your commits for alittle while to help you with any sharp edges y … | Continue reading
I was reading the latest issue of Pycoder's Weekly [http://pycoders.com/] andthey mentioned Thomas Kluyver's pull request[https://github.com/pypa/pip/pull/4144] to implement PEP 518[https://www.python.org/dev/peps/pep-0518/] in pip. The newsletter linked tothe reddit thread[ht … | Continue reading
While developing the CLA bot for CPython[https://github.com/python/the-knights-who-say-ni] (aka, the Knights Who SayNi), I decided to make it asynchronous, partially for performance reasons butalso because I simply wanted to. 😁 The problem with doing that for a GitHub bo … | Continue reading
When one thinks of ways of customizing classes at creation time, people probablytypically think of metaclasses and class decorators. Metaclasses are attypically viewed as the beginning of class creation while class decorators areat the end. But what you may not know is that ther … | Continue reading
One of the hardest parts of doing a new release of CPython is getting people totest it before the final release goes out. While CPython has a test suite and wetry to do our best to have good code coverage (currently sitting at above 83%[https://codecov.io/gh/python/cpython]), not … | Continue reading
During his PyCon US 2015 keynote, Guido stated that we "[wanted] at least twofemail core devs [https://youtu.be/G-uKNd5TSBw?t=13m40s]" by PyCon US 2016.Guido, Raymond Hettinger, and myself offered to help mentor women who wanted tobe core devs to help make this happen. It may not … | Continue reading
The CLA bot for the PSF [https://github.com/python/the-knights-who-say-ni] isdesigned defensively because if the bot accidentally lets a pull request throughfrom someone that has not signed the CLA that could lead to legal troubles. Toalleviate any worries I may have about bugs … | Continue reading
It all started when ...While developing the CLA bot for Python[https://github.com/python/the-knights-who-say-ni] I realized this might not bethe last bot I or anyone else may have to write for helping with CPython'sdevelopment once it shifts to GitHub. As such, I began to think … | Continue reading