<p><strong>Watch the live stream:</strong></p>
<a href='https://www.youtube.com/watch?v=8EAa8-3Fj84' style='font-weight: bold;'>Watch on YouTube</a><br>
<br>
<p><strong>About the show</strong></p>
<p>Sponsored by <a href="http://pythonbytes.fm/foundershub2022"><strong>Microsoft for Startups Founders Hub</strong></a>.</p>
<p><strong>Michael #1:</strong> <a href="https://github.com/mikaelho/python-human-regex"><strong>Human regular expressions revisited</strong></a></p>
<ul>
<li>via Mikael Honkala</li>
<li>We mentioned of Al Sweigart's humre in Python Bytes… </li>
<li>Mikael went on a little search and compiled my findings into this repo.</li>
<li>A lot of people feel that re needs some help. At least 3 of the "serious" packages I found came out in the last few months.</li>
<li>Since a package like this is not overly complex to make, all the ways to approach the problem are clearly being explored.</li>
<li>Unfortunately these seem to be mostly single-person efforts, and many have fallen to the wayside before long.</li>
<li>Hopefully there's some consolidation on the horizon, to share some of the maintenance effort and establish some of the packages as here for the long haul.</li>
<li>The list could be useful to you if you are:
<ul>
<li><em>Looking for a tool</em>: Check the list to get a quick idea of the "look and feel" of each package.</li>
<li><em>Thinking about building a tool</em>: Check the list for alternative approaches, and maybe consider if contributing to an existing package might be a better way to get what you need.</li>
<li><em>Building a tool, or already have one</em>: Use the list to clarify and communicate what the main differences and strengths of your solution are.</li>
</ul></li>
</ul>
<p><strong>Brian #2:</strong> <a href="https://mypy-lang.blogspot.com/2022/09/mypy-0981-released.html"><strong>Implicit Optional Types Will Be Disabled by Default</strong></a></p>
<ul>
<li>… in a future mypy feature release (possibly the next one after 0.98x) …</li>
<li>Thanks Adam Johnson for spotting this and letting us know</li>
<li>Stop doing this: <code>s: str = None</code></li>
<li>Do one of these:
<ul>
<li><code>s: str | None = None</code></li>
<li><code>s: Union[str, None] = None</code> </li>
<li><code>s: Optional[str] = None</code> ← but this has problems</li>
</ul></li>
<li>Optional != optional
<ul>
<li>From <a href="https://docs.python.org/3/library/typing.html">python docs</a>:
<ul>
<li>”<code>Optional[X]</code> is equivalent to <code>X | None</code> (or <code>Union[X, None]</code>).”</li>
<li>“Note that this is not the same concept as an optional argument, which is one that has a default. An optional argument with a default does not require the <code>Optional</code> qualifier on its type annotation just because it is optional. “</li>
</ul></li>
</ul></li>
<li>Best described in FastAPI docs, <a href="https://fastapi.tiangolo.com/python-types/#possibly-none">Python Types Intro, starting at “Possibly</a> <a href="https://fastapi.tiangolo.com/python-types/#possibly-none">None</a><a href="https://fastapi.tiangolo.com/python-types/#possibly-none">"</a></li>
<li>Recommendation is to use:
<ul>
<li><code>s: str | None = None</code> for Python 3.10+</li>
<li><code>s: Union[str, None] = None</code> for Python 3.9+</li>
</ul></li>
<li>For 3.7, 3.8, you still have <code>Optional</code> as an option, I think.
<ul>
<li>Why haven’t you upgraded to 3.9? We’re almost to 3.11, what’s the problem?!</li>
</ul></li>
</ul>
<p><strong>Michael #3:</strong> <a href="https://github.com/MarcoGorelli/cython-lint"><strong>cython-lint</strong></a></p>
<ul>
<li>by Marco Gorelli</li>
<li>A tool (and pre-commit hook) to lint Cython files, similar to how flake8 lints Python files, and works by parsing Cython's own AST (abstract syntax tree).</li>
<li>Found quite a few nice clean-ups which could be applied on:
<ul>
<li>pandas</li>
<li>numpy</li>
<li>scikit-learn</li>
<li>cupy</li>
</ul></li>
</ul>
<p><strong>Brian #4:</strong> <a href="https://difftastic.wilfred.me.uk/introduction.html"><strong>difftastic</strong></a> - structural diff</p>
<ul>
<li>“Difftastic is a structural diff tool that understands syntax.”</li>
<li>“Difftastic <a href="https://difftastic.wilfred.me.uk/usage.html#language-detection">detects the language</a>, parses the code, and then compares the syntax trees.”</li>
<li>Interesting story about <a href="https://www.wilfred.me.uk/blog/2022/09/06/difftastic-the-fantastic-diff/?utm_source=pocket_mylist">building difftastic</a></li>
<li>For one off <code>git diff</code> replacement
<ul>
<li>use <code>GIT_EXTERNAL_DIFF=difft git diff</code></li>
<li>or <code>GIT_EXTERNAL_DIFF="difft --syntax-highlight=off" git diff</code></li>
</ul></li>
<li>To always use <code>difft</code> with git, see https://difftastic.wilfred.me.uk/git.html</li>
</ul>
<p><strong>Extras</strong> </p>
<p>Brian:</p>
<ul>
<li><a href="https://ohmygit.org"><strong>Oh My Git!</strong></a> - An open source game about learning Git!</li>
<li><a href="https://pythoninsider.blogspot.com/2022/09/python-3110rc2-is-now-available.html?utm_source=pocket_mylist"><strong>Python 3.11.0 is up to rc2</strong></a></li>
</ul>
<p>Michael:</p>
<ul>
<li><a href="https://nextdns.io/?from=a743zhpr"><strong>NextDNS</strong></a></li>
</ul>
<p><strong>Joke:</strong> <a href="https://twitter.com/PR0GRAMMERHUM0R/status/1570578245048729600"><strong>I mean, who’s wrong?</strong></a></p>
↧