<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Python on BXM.net</title>
    <link>https://bxm.net/tags/python/</link>
    <description>Recent content in Python on BXM.net</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 22 Oct 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://bxm.net/tags/python/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>BXM Canon 0.3.0 Adds Python, With Ints, Floats and Bytes Kept Apart and the Same Hash as Every Other Build</title>
      <link>https://bxm.net/bxm-canon-0.3.0-adds-python-with-ints-floats-and-bytes-kept-apart-and-the-same-hash-as-every-other-build/</link>
      <pubDate>Thu, 22 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://bxm.net/bxm-canon-0.3.0-adds-python-with-ints-floats-and-bytes-kept-apart-and-the-same-hash-as-every-other-build/</guid>
      <description>&lt;p&gt;BXM Canon 0.3.0 adds a Python package. It&amp;rsquo;s the same Rust core again, this time called through PyO3, with wheels for Linux, macOS and Windows and any Python from 3.9 up. A value hashed in Python gives the hash the command line, the C library and the JavaScript package give, because all of them run the same code.&lt;/p&gt;&#xA;&lt;p&gt;Python turned out to be the most natural fit so far. JavaScript has one number type, so a JavaScript caller has to think about whether &lt;code&gt;1&lt;/code&gt; should be an integer or a float. Python already keeps &lt;code&gt;int&lt;/code&gt; and &lt;code&gt;float&lt;/code&gt; apart, and it has a real &lt;code&gt;bytes&lt;/code&gt; type, which is exactly what Canon distinguishes. So the Python package can take a value straight from your program, no text step in between.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hashing 100,000 JSON Lines Found No Duplicates, Hashing Them With Canon Found 9,900</title>
      <link>https://bxm.net/hashing-100000-json-lines-found-no-duplicates-hashing-them-with-canon-found-9900/</link>
      <pubDate>Thu, 22 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://bxm.net/hashing-100000-json-lines-found-no-duplicates-hashing-them-with-canon-found-9900/</guid>
      <description>&lt;p&gt;Event pipelines get the same event twice. A producer times out, retries, and the retry goes through a different service that writes JSON its own way. The usual dedupe is a hash of each line, and it quietly misses all of these.&lt;/p&gt;&#xA;&lt;p&gt;We generated a stream of 100,000 JSON lines from a fixed seed, 13.1 MB in all. 90,000 are distinct purchase events. The other 10,000 are resends of earlier events, written by two other producers. One sorts the keys and escapes non-ASCII, so &amp;ldquo;Zürich&amp;rdquo; arrives as &lt;code&gt;Z\u00fcrich&lt;/code&gt;. The other reverses the key order and adds spaces. For a twist, 100 of the resends come from a producer that writes the quantity as a float: &lt;code&gt;2.0&lt;/code&gt; where the original said &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>One Order Built in Python, JavaScript and by Hand Gives Three JSON Hashes and One Canon Hash</title>
      <link>https://bxm.net/one-order-built-in-python-javascript-and-by-hand-gives-three-json-hashes-and-one-canon-hash/</link>
      <pubDate>Thu, 22 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://bxm.net/one-order-built-in-python-javascript-and-by-hand-gives-three-json-hashes-and-one-canon-hash/</guid>
      <description>&lt;p&gt;A checkout service written in Python signs each order before it hands it on. A fulfilment service written in JavaScript checks the signature before it ships anything. Both have the same order in memory. The question is whether they agree on its bytes.&lt;/p&gt;&#xA;&lt;p&gt;We built one order three ways. Python filled a dict in the order its code reads, and &lt;code&gt;json.dumps&lt;/code&gt; wrote it with its defaults: a space after every comma and colon, and &amp;ldquo;Zürich&amp;rdquo; escaped as &lt;code&gt;Z\u00fcrich&lt;/code&gt;. JavaScript built the same object with its keys in another order, and &lt;code&gt;JSON.stringify&lt;/code&gt; wrote it compactly with the ü left as it is. The third copy is a file written by hand, pretty-printed, with yet another key order, hashed with the &lt;code&gt;bxm-canon&lt;/code&gt; command.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
