<p><strong>Watch the live stream:</strong></p> <a href='https://www.youtube.com/watch?v=7LkGcaehEek' style='font-weight: bold;'>Watch on YouTube</a><br> <br> <p><strong>About the show</strong></p> <p>Sponsored by Datadog: <a href="http://pythonbytes.fm/datadog"><strong>pythonbytes.fm/datadog</strong></a></p> <p>Special guest: Luciana</p> <p><strong>Brian #1:</strong><a href="https://github.com/textualize/rich-cli"><strong>rich-cli</strong></a></p> <ul> <li>suggested by Lance Reinsmith</li> <li><code>rich</code> on the command line.</li> <li>why? <ul> <li>syntax highlighting <ul> <li><code>rich example.py</code></li> <li><code>rich -m README.md</code> use <code>-m</code> for markdown <ul> <li>why Will? <code>.md</code> seems clear enough to me. </li> </ul></li> </ul></li> <li>comes with themes. ex: <code>--theme monokai</code> </li> <li>formats json, <code>--json</code> or <code>-j</code></li> </ul></li> <li>and a bunch of other features I probably won’t use, but you might. <ul> <li>alignment, maybe</li> <li>width, yeah, I’ll probably use <code>-w</code></li> <li>a bunch more</li> </ul></li> <li>In my .zshrc: <code>alias cat='rich --theme monokai'</code> <ul> <li>after <code>pipx install rich-cli</code></li> <li>feel free to tell me that I shouldn’t used cat for looking at file contents. (although, why not?)</li> <li>I’m not, I’m using rich. :)</li> </ul></li> </ul> <p><strong>Luciana</strong> <strong>#2:</strong> <a href="https://github.com/Microsoft/debugpy"><strong>debugpy</strong></a> - a debugger for Python</p> <ul> <li>The debugger we use in the Python extension for VS Code</li> <li>Super heplful features that can save up a lot of time and a lot of folks don’t seem to know about: <ul> <li><a href="https://code.visualstudio.com/Docs/editor/debugging#_conditional-breakpoints">Conditional breakpoints</a> <ul> <li>Helpful when you want the code to break only on a specific condition</li> <li>e.g. # of execution times, or when an expression is true </li> </ul></li> <li><a href="https://code.visualstudio.com/Docs/editor/debugging#_debug-console-repl">Debug console</a> <ul> <li>Helpful for quick testing using the context of the program at the breakpoint </li> <li>Temp edits on variable values, expresison evaluation, etc. </li> </ul></li> <li><a href="https://devblogs.microsoft.com/python/python-in-visual-studio-code-february-2020-release/#in-case-you-missed-it-jump-to-cursor">Jump to Cursor</a> (a.k.a. Set Next Statement) <ul> <li>Control on what is the next line the debugger will execute</li> <li>Including previously executed lines</li> </ul></li> </ul></li> </ul> <p><strong>Brian #3:</strong> <a href="https://simonwillison.net/2018/Jul/28/documentation-unit-tests"><strong>Documentation unit tests</strong></a></p> <ul> <li>Simon Willison</li> <li>Post talking about using pytest and tests to check documentation.</li> <li>Simon has test code that <ul> <li>introspects the code</li> <li>introspects the docs</li> <li>then makes sure some items are definitely in the docs</li> </ul></li> <li>This is used in Datasette, so you can look at the example in the repo</li> <li>What’s tested: <ul> <li>config options are all documented</li> <li>plugin hooks are documented</li> <li>views are all documented</li> </ul></li> <li>Cool use of parametrize to generate test cases based on introspection</li> <li>Nice use of fixtures</li> <li>Very cool idea</li> </ul> <p><strong>Luciana</strong> <strong>#4:</strong> <a href="https://www.python.org/dev/peps/pep-0673"><strong>PEP 673 — Self Type</strong></a></p> <ul> <li>Heard from Brett Cannon that it has been accepted!</li> <li>Interesting for me as I’m learning more about types in Python </li> <li>Adds a way to annotate methods that return an instance of their class </li> <li>Particularly interesting for subclasses, exemple they gave: from __future__ import annotations class Shape:</li> </ul> <pre><code>def set_scale(self, scale: float) -> Shape: self.scale = scale return self class Circle(Shape): def set_radius(self, r: float) -> Circle: self.radius = r return self Circle().set_scale(0.5) # *Shape*, not Circle Circle().set_scale(0.5).set_radius(2.7) # => Error: Shape has no attribute set_radius </code></pre> <p><strong>Extras</strong></p> <p>Luciana:</p> <ul> <li><a href="https://github.com/psf/black/releases/tag/22.1.0">Black</a> is no longer in beta! Version 22.1.0 is out 🥳</li> <li><a href="https://pretix.eu/pycascades/remote-2022/">PyCascades 2022</a> reminder (remote!)</li> </ul> <p><strong>Joke:</strong> </p> <p><img src="https://ift.tt/kXshSAH" alt="" /></p>
from Planet Python
via read more
Subscribe to:
Post Comments (Atom)
TestDriven.io: Working with Static and Media Files in Django
This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...
-
Podcasts are a great way to immerse yourself in an industry, especially when it comes to data science. The field moves extremely quickly, an...
-
Graph traversal algorithms are used to perform various operations on a graph data structure. In this article, we will use the breadth-first ...
-
In an earlier tutorial we've already covered how to open dialog windows. These are special windows which (by default) grab the focus o...
No comments:
Post a Comment