⇦ 2024-10-17 Adding syntax to the cpython interpreter Condensed version of this cool blog post. Let's add some new syntax to Python! Making a small change is not so hard. Our aim is to make ternary statements default to None as they do in Ruby: >>> "hello" if 2 + 2 == 4 "hello" >>> "hello" if 2 + 2 == 5 None In existing Python, we get an error: File "<python-input-0>", line 1 "hello" if 2 + 2 == 5
TypedDict was introduced in PEP-589 which landed in Python 3.8. The primary use case was to create type annotations for dictionaries. For example, class Movie(TypedDict): title: str movie: Movie = {"title": "Avatar"} I remember thinking at the time that this was pretty neat, but I tend to use dataclass or pydantic to represent 'record' type data. Instead I use dictionaries more as a collection, so
This wiki is in the process of being archived due to lack of usage and the resources necessary to serve it — predominately to bots, crawlers, and LLM companies. Edits are discouraged. Pages are preserved as they were at the time of archival. For current information, please visit python.org. If a change to this archive is absolutely needed, requests can be made via the infrastructure@python.org mai
For every bytecode compiled language, the most interesting part of its implementation is its virtual machine (also referred to as the bytecode interpreter) where the bytecode execution takes place. Because this is such a crucial part of the language machinery, its implementation has to be highly performant. Even if you are not a compiler engineer, learning about such internal implementation can gi
I remember Animats mentioned a naive, execution strategy of another project. Seeing two articles, I wonder if anyone made a list of many implementation strategies for bytecode interpreters with links to examples. Very informative read. I wonder if it’s start becoming more popular for people to compile & distribute Python byte code once the JIT is done similar to how Java does it. Unlike JVM byte c
Plateauの公式で配布されているデータがちょっと使いづらい みなさん、Plateauのデータ活用されているでしょうか? そもそもPlateauってなにという人はこちらの公式サイトを見てください。 見てない方向けに端的に言うと建物3DデータなどをCityGMLという形式で配っています。 また、そのほかにもFBXとOBJファイルでも配られていてこちらは、一見手軽に使えそうな気がするんですが、平面直角座標系という座標系で三次元座標に変換されているのですが、この座標系の場合中心が遠くになってしまう場合が多く非常に使いづらいです。 そのため、編集モードで全選択して中心に持ってくるなどの方法が紹介されていますが、この場合緯度経度と三次元座標の対応がわからなくなってしまいます。 この方法だと地域メッシュの中心が中心には来ず、ずれた位置に来ることになります。 BlenderでCityGMLを直接読み込
PEP 750 – Template Strings Author: Jim Baker <jim.baker at python.org>, Guido van Rossum <guido at python.org>, Paul Everitt <pauleveritt at me.com>, Koudai Aono <koxudaxi at gmail.com>, Lysandros Nikolaou <lisandrosnik at gmail.com>, Dave Peck <davepeck at davepeck.org> Discussions-To: Discourse thread Status: Final Type: Standards Track Created: 08-Jul-2024 Python-Version: 3.14 Post-History: 09-
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く