サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Pixel 9
treyhunner.com
When I discovered Python’s new pathlib module a few years ago, I initially wrote it off as being a slightly more awkward and unnecessarily object-oriented version of the os.path module. I was wrong. Python’s pathlib module is actually wonderful! In this article I’m going to try to sell you on pathlib. I hope that this article will inspire you to use Python’s pathlib module pretty much anytime you
Note: This post was originally titled “Stop writing lambda expressions in Python” but I’ve changed the title after deciding that it was a little too extreme. It’s hard for me to teach an in-depth Python class without discussing lambda expressions. I almost always get questions about them. My students tend to see them in code on StackOverflow or they see them in a coworker’s code (which, realistica
Whether I’m teaching new Pythonistas or long-time Python programmers, I frequently find that Python programmers underutilize multiple assignment. Multiple assignment (also known as tuple unpacking or iterable unpacking) allows you to assign multiple variables at the same time in one line of code. This feature often seems simple after you’ve learned about it, but it can be tricky to recall multiple
Sometimes the Pythonic way to solve a problem changes over time. As Python has evolved, so has the Pythonic way to count list items. Let’s look at different techniques for counting the number of times things appear in a list. While analyzing these techniques, we will only be looking at code style. We’ll worry about performance later. We will need some historical context to understand these differe
このページを最初にブックマークしてみませんか?
『treyhunner.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く