Python Bytes is a weekly podcast hosted by Michael Kennedy and Brian Okken. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.

Similar Podcasts

Thinking Elixir Podcast

Thinking Elixir Podcast
The Thinking Elixir podcast is a weekly show where we talk about the Elixir programming language and the community around it. We cover news and interview guests to learn more about projects and developments in the community.

Rocket

Rocket
Countdown to excitement! Every week Christina Warren, Brianna Wu and Simone de Rochefort have accelerated geek conversation. Tech, comics, movies, games and books, no galaxy is off limits! Hosted by Christina Warren, Brianna Wu, and Simone De Rochefort.

The Infinite Monkey Cage

The Infinite Monkey Cage
Brian Cox and Robin Ince host a witty, irreverent look at the world through scientists' eyes.

#268 Wait, you can Google that?

January 27, 2022 00:45:09 38.78 MB Downloads: 0

Watch the live stream: Watch on YouTube About the show Sponsored by us: Check out the courses over at Talk Python And Brian’s book too! Special guest: Madison @AetherUnbound Brian #1: (draft) PEP 679 -- Allow parentheses in assert statements Pablo Galindo Salgado This is in draft, not approved, and not scheduled for any release But it seems like a really good idea to me. assert(1 == 2, "seems like it should fail") will always pass currently since the tuple (False,"seems like it should fail") is a non-empty tuple. Current Python will emit a warning >>> assert(1 == 2, "seems like it should fail") [stdin]:1: SyntaxWarning: assertion is always true, perhaps remove parentheses? But really, why not just change the language to allow assert with or without parens. Also would allow multi-line assert statements more easily: assert ( very very long expression, "very very long " "message", ) I hope this is a slam dunk and gets in ASAP. Michael #2: Everything I googled as a dev by Sophie Koonin In an attempt to dispel the idea that if you have to google stuff you’re not a proper engineer, this is a list of nearly everything I googled in a week at work Rather than my posting a huge list, check out the day logs on her post Worth calling out a few: Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? - said React upgrade then started causing some super fun errors. semantic HTML contact details - wanted to check if the [HTML_REMOVED] tag was relevant here editing host file - desperate times (and it didn’t even work) Madison #3: PyCascades 2022! Another year of excellent and diverse talks across an array of subjects. Talks from some well known folks (Thursday Bram, Jay Miller) as well as first time speakers (Joseph Riddle, Isaac Na) PSF’s DE&I Panel is doing a meet & greet, and they have a survey they’d like Python community members to fill out. Socials Friday & Saturday night, sprints on Sunday. Tickets are still available! Brian #4: Strict Python function parameters Seth Michael Larson We have keyword only parameters def process_data(data, *, encoding="ascii"): ... notice the * encoding has to be a keyword argument, cannot be positional. We have position only parameters: def process_data(data, /, encoding="ascii"): ... notice the / data has to be positional, cannot be passed in as a keyword argument Combine the two: def process_data(data, /, *, encoding="ascii"): ... Now data has to be positional, and encoding has to be a keyword, if present. This way a function really can only be called as intended and all uses of the function will be consistent. This is a good thing. There are many benefits, including empowering library authors to make changes without weird behaviors cropping up in user code. Commentary: extra syntax may be confusing for some new users. For a lot of library API entry points, I think this makes a lot of sense. Michael #5: mureq - vendored requests mureq is a single-file, zero-dependency alternative to python-requests Intended to be vendored in-tree by Linux systems software and other lightweight applications. Doesn’t support connection pooling (but neither does requests.get()). Uses much less memory Avoids supply chain attack vulnerabilities Consider my prod branch until PRs #2 and #3 are merged. Madison #6: Openverse No, not Metaverse! Previously “CC Search” Search engine for openly licensed media, for free and public use/remix of content. Currently images & audio, hope to include video, text, 3D models down the line. Start your search here Extras Michael: We now have playable times in the transcript section (example). Very cool tool for building regex-es I used for the above: regex101.com Next video is out: Do you even need loops in Python? A Python short by Michael Kennedy Remember, we have full-text search Brian: pip-secure-install - from Brett Cannon Python Testing with pytest is, when I last checked, the #2 bestseller at Pragmatic so cool My Maui trip was also a work trip. Gave me time to completely re-read the book, make notes, and make last minute changes. Changes went in this week and tonight is my “pencils down” date. This is getting real, folks. Thanks to everyone for buying beta copies and supporting the re-write. Madison: spd.watch - new police accountability/information tool for the Seattle area Shoutout to just (mentioned in Ep 242) ghcr.io - free docker image hosting for open source projects, easy integration with GitHub Actions Joke: via Josh Thurston How did the hacker get away from the police? He just ransomware. That joke makes me WannaCry… Where do you find a hacker? In decrypt.

#267 Python on the beach

January 21, 2022 00:32:50 29.12 MB Downloads: 0

Watch the live stream: Watch on YouTube About the show Sponsored by us: Check out the courses over at Talk Python And Brian’s book too! Michael #1: Box: Python dictionaries with advanced dot notation access Want to treat dictionaries like classes? Box. small_box = Box({'data': 2, 'count': 5}) small_box.data == \ small_box['data'] == \ getattr(small_box, 'data') == \ small_box.get('data') There are over a half dozen ways to customize your Box and make it work for you: Check out the new Box github wiki for more details and examples! Superset of dict See Types of Boxes as well Brian #2: Reading tracebacks in Python Trey Hunner “When Python encounters an error in your code, it will print out a traceback. Let's talk about how to use tracebacks to fix our code.” Brian’s commentary Tracebacks can feel like brick wall of error telling you “you suck”. But they are really meant to help you, and do, once you know how to read them. Probably should be one of the earliest things we teach people new to coding. Like maybe: hello world tracebacks testing Anyway, back to Trey Start at the bottom. Read the last line first That will have the type of exception and an error message The two lines above that are The exact filename and line number where the exception occurs a copy of the line Those two lines are a stack frame. Keep going up and it’s other stack frames for the callstack of how you got here. Trey walks through this with an example and shows how to solve an error at a high level stack frame using the traceback. Michael #3: Raspberry Pi: These two new devices just went live on the International Space Station The International Space Station has connected new Raspberry 4 Model B units to run experiments from 500 student programmer teams in Europe. From the education-focused European Astro Pi Challenge These are new space-hardened Raspberry Pi units, dubbed Astro Pi The AstroPi units are part of a project run by the European Space Agency (ESA) for the Earth-focused Mission Zero and Mission Space Lab. The former allows young Python programmers to take humidity readings on board ISS while the latter lets students run various scientific experiments on the space station using its sensors. Brian #4: Make Simple Mocks With SimpleNamespace Adam Johnson Who’s crushing it recently, BTW, lots of recent blog posts SimpleNamespace is in the types standard library package. Works great as a test double, especially as a stub or fake object. “It’s as simple as possible, with no faff around being callable, tracking usage, etc.” Example: >from types import SimpleNamespace >obj = SimpleNamespace(x=12, y=17, verbose=True) >obj namespace(x=12, y=17, verbose=True) >obj.x 12 >obj.verbose True unittest.mock.Mock also works, but has the annoying feature that, unless you pass in a spec, any attribute will be allowed. The SimpleNamespace solution doesn’t allow any typos or other attributes. Example: >obj.vrebose Traceback (most recent call last): File "[HTML_REMOVED]", line 1, in [HTML_REMOVED] AttributeError: 'types.SimpleNamespace' object has no attribute 'vrebose'. Did you mean: 'verbose'? Michael #5: Extra, extra, exta Marak Squires, supply chain issues (NPM), and terrorism? [npm issues] css outlines! python 3.10.2 Python Shorts YouTube series #1 Parsing data with Pydantic #2 Counting the number of times items appear with collections.Counter Stream Deck + PyCharm video, github repo Brian #6: 3 Things You Might Not Know About Numbers in Python David Amos Most understated phrase I’ve read in a long time: “… there's a good chance that you've used a number in one of your programs” There’s more to numbers than many people realize The 3 things numbers have methods integers have to_bytes(length=1, byteorder="big") int.from_bytes(b'\x06\xc1', byteorder="big") class method bit_length() and a bunch of others floats have is_integer(), as_integer_ratio() and a bunch more use variables or parentheses, though. 5.bit_length() doesn’t work n=5; n.bit_length() and (5).bit_length() works numbers have hierarchy Every number in Python is an instance of the Number class. so isinstance(value, Number) should work for any number type Then there’s 4 abstract types encompassing other types Complex: has type complex Real: has float Rational: has Fraction Integral: has int and bool Where’s Decimal? It’s not part of those abstract types, it directly inherits from Number Also, floats are weird Numbers are extensible You can derive from numeric classes, both abstract and concrete, and create your own However, to do this effectively, you gotta implement A LOT of dunder methods. Joke:

#266 Python has a glossary?

January 13, 2022 26:46 24.08 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/266.

#265 Get asizeof pympler and muppy

January 05, 2022 00:47:46 40.85 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/265.

#264 We're just playing games with Jupyter at this point

December 22, 2021 00:53:02 46.04 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/264.

#263 It’s time to stop using Python 3.6

December 15, 2021 00:50:07 43.59 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/263.

#262 So many bots up in your documentation

December 09, 2021 00:43:06 37.04 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/262.

#261 Please re-enable spacebar heating

December 03, 2021 00:42:21 36.76 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/261.

#260 It's brutally simple: made just from pickle and zip

November 23, 2021 00:48:49 41.13 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/260.

#259 That argument is a little late-bound

November 17, 2021 00:47:24 42.57 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/259.

#258 Python built us an anime dog!

November 11, 2021 00:43:09 38.58 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/258.

#257 Python Launcher - Launching Python Everywhere

November 04, 2021 00:40:25 36.21 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/257.

#256 And the best open source project prize goes to ...

October 29, 2021 00:59:36 51.69 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/256.

#255 Closember eve, the cure for Hacktoberfest?

October 20, 2021 00:46:49 41.04 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/255.

#254 Do Excel things, get notebook Python code with Mito

October 13, 2021 00:31:02 26.87 MB Downloads: 0

See the full show notes for this episode on the website at pythonbytes.fm/254.