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.

Espacio Cripto

Espacio Cripto
Lalo y Abraham te ayudarán a entender el espacio de las criptomonedas con un lenguaje simple y de forma entretenida. Queremos que más gente entienda esta tecnología porque es la siguiente enorme revolución y eventualmente la usarás, como usas el internet.

The Infinite Monkey Cage

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

#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.

#253 A new Python for you, and for everyone!

October 07, 2021 00:44:57 37.98 MB Downloads: 0

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