Learn Python with Talk Python's 270 hours of courses

Python Bytes Crossover 2023

Episode #443, published Fri, Dec 29, 2023, recorded Tue, Dec 19, 2023

Special crossover episode of Python Bytes to wrap up 2023. Topics include:

      Extras

Watch this episode on YouTube
Play on YouTube
Watch the live stream version

Sponsored by us! Support our work through:


Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be
part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too.

Michael #1: Hatch v1.8

  • Hatch now manages installing Python for you.
  • Hatch can build .app and .exe stand-alone binaries for you
  • The macOS ones are signed (signed!)
  • Discussion here

Brian #2: svcs : A Flexible Service Locator for Python

  • Hynek
  • A library to help structure and test Python web applications.
  • svcs (pronounced services) is a dependency container* for Python. It gives you a central place to register factories for types/interfaces and then imperatively acquire instances of those types with automatic cleanup* and **health checks.”
  • “Benefits:
    • Eliminates tons of repetitive boilerplate code,
    • unifies acquisition* and cleanups of services,
    • provides full static type safety for them,
    • simplifies testing through loose coupling,
    • improves live introspection and monitoring* with **health checks.”
  • Hynek has started a YouTube channel, and is starting with an explanation of svcs.
  • Yes, Hynek, we want more videos. I like that it’s not a beginner level.
  • My request for future videos: just past beginner, and also intermediate level.
  • There are plenty of basics videos out there, not as many filling the gaps between beginner and production.

Michael #3: Steering Council 2024 Term Election Results

  • The 2024 Term Python Steering Council is:
    • Pablo Galindo Salgado
    • Gregory P. Smith
    • Emily Morehouse
    • Barry Warsaw
    • Thomas Wouters
  • Full results are available in PEP 8105 .
  • How do you become a candidate?
    • Candidates must be nominated by a core team member. If the candidate is a core team member, they may nominate themselves.

Brian #4: Python protocols. When to use them in your projects to abstract and decoupling

  • Carlos Vecina
  • “Protocols are an alternative (or a complement) to inheritance, abstract classes and Mixins.”
  • Understanding interactions between ABC, MixIns and Protocols in Python
  • With examples

Extras

Brian:

Michael:

  • Mastodon guidelines (mine):
    • If you have a picture and description, I’ll probably follow you back
    • If you have posts that seem relevant +1
    • If you have a verified webpage +1
    • If your account is private, won’t. I don’t understand really since private group messages already exist and the profile itself is public.
  • Speaking of Mastodon. I had a productive conversation with the PSF and others around masks and conferences.
  • Dropbox spooks users by sending data to OpenAI for AI search features
  • Beyond privacy, this got me thinking, just how many hours of dev time have been diverted to add mediocre-at-best AI features to everything?
  • I’m doing a big digital decluttering and have lots to say on that soon.
  • Not submitting my talks to PyCascades this year.
  • But I did submit 3 talks to PyCon US. 🤞
  • I will be giving the keynote at PyCon Philippines.

Joke: The dream is dead?

Episode Deep Dive

Guests

Brian Okken is a seasoned Python developer and the co-host of the "Python Bytes" podcast. With a strong background in software development and a passion for creating efficient and scalable Python applications, Brian brings valuable insights into Python’s evolving ecosystem. His expertise in testing, dependency management, and modern Python practices makes him an essential voice in the Python community.

Michael Kennedy is a renowned Python developer, educator, and the host of the "Talk Python To Me" podcast. With over a decade of experience in the Python community, Michael is passionate about teaching and empowering developers through his extensive range of courses at Talk Python Training. His expertise spans across Python web development, data science, and software engineering best practices, making him a beloved figure among Python enthusiasts.

Key Points and Takeaways

  • Hatch v1.8: Enhancing Python Project Management

    Hatch is a modern Python packaging tool comparable to Flit, PDM, and Poetry. In version 1.8, Hatch has expanded its capabilities to manage not just Python projects but also the Python interpreter itself. This evolution addresses the ongoing debate within the Python community about whether environment management should focus solely on projects or include the Python runtime.

    • PyApp Integration: Introduced as part of Hatch v1.8, PyApp is a runtime installer for Python projects written in Rust. It allows Python applications to be distributed as standalone executables (.exe for Windows, .app for macOS), simplifying deployment for end-users.
    • Cross-Platform Support: PyApp provides signed installers for multiple platforms, ensuring security and reducing installation barriers.
    • Performance Improvements: Hatch now includes a hashing mechanism for dependencies, significantly speeding up virtual environment activation by avoiding unnecessary checks.
    • Discussion: For more details, join the discussion here.
  • svcs: A Flexible Service Locator for Python

    svcs is a versatile service locator designed to streamline dependency management in Python applications. While primarily intended for web applications, its flexible architecture makes it suitable for various types of projects.

    • Dependency Injection Alternative: svcs offers a different approach compared to traditional dependency injection, focusing on inversion of control without requiring base class inheritance.
    • Comprehensive Documentation: The project includes extensive documentation with examples across frameworks like FastAPI, Flask, Pyramid, and Starlet, making it easy to integrate into existing projects.
    • Benefits:
      • Eliminates tons of repetitive boilerplate code.
      • Unifies acquisition and cleanups of services.
      • Provides full static type safety.
      • Simplifies testing through loose coupling.
      • Improves live introspection and monitoring with health checks.
    • Community Engagement: Hynek has started a YouTube channel with an explanation of svcs. Future videos are requested to focus on intermediate levels to fill gaps between beginner and production.
  • Steering Council 2024 Election Results

    The Python Steering Council for the 2024 term has been elected, bringing fresh leadership to guide Python's future development. The newly elected members are:

    • Pablo Galindo Salgado
    • Gregory P. Smith
    • Emily Morehouse
    • Barry Warsaw
    • Thomas Waters

    These leaders are well-respected within the community, and their election ensures continued robust governance for Python's evolution. For detailed voting results and candidate information, refer to PEP 8105.

    • Becoming a Candidate: Candidates must be nominated by a core team member. If the candidate is a core team member, they may nominate themselves.
  • Understanding Python Protocols

    Python protocols, introduced in Python 3.8, are a powerful feature for enhancing type hinting and ensuring code reliability. They allow developers to define expected behaviors without enforcing strict inheritance hierarchies.

    • Defining Protocols: By inheriting from Protocol, developers can specify method signatures that implementing classes must adhere to, enabling more flexible and maintainable code structures.
    • Type Checking Enhancements: Tools like PyCharm can leverage protocols to perform more accurate type checking, ensuring that objects conform to expected interfaces without requiring explicit inheritance.
    • Comparison with Duck Typing: While Python's duck typing allows for flexible code, protocols provide a way to enforce interface contracts at the type-checking level, bridging the gap between dynamic typing and static type safety.
    • Article Reference: For an in-depth understanding, read Python protocols: When to use them in your projects to abstract and decoupling.
  • Posit Connect: Streamlining Deployment

    Posit Connect, sponsored by the episode, is a deployment platform from the makers of Shiny. It supports a wide range of Python tools and frameworks, including Streamlit, Dash, Shiny for Python, Bokeh, FastAPI, Flask, and more.

    • Comprehensive Support: Posit Connect simplifies the deployment process for various Python-based data projects, enabling developers to publish, share, and manage their applications with ease.
    • Enterprise-Ready Features: With robust security and IT compliance features, Posit Connect is suitable for enterprise environments, ensuring that deployments meet organizational standards.
    • Free Trial Available: Developers can try Posit Connect for free for three months by visiting talkpython.fm/posit.
  • Community Engagement on Mastodon

    The hosts discuss their experiences with Mastodon, emphasizing the importance of meaningful interactions and the challenges of connecting with new followers who may have incomplete profiles.

    • Building Connections: Engaging with the Python community on Mastodon fosters deeper relationships and collaborative opportunities.
    • Profile Best Practices: Encouraging followers to maintain complete and consistent profiles across platforms helps in building trust and recognition within the community.
    • Mastodon Guidelines:
      • If you have a picture and description, you’ll probably follow back.
      • If you have relevant posts, it’s a plus.
      • If you have a verified webpage, it’s another plus.
      • Private accounts are less likely to be followed back due to unclear intentions.
  • Dropbox's New AI Features and Privacy Concerns

    Dropbox has introduced new AI-driven features that can automatically process and send private documents to OpenAI. While these features enhance functionality, they raise privacy concerns regarding data handling and user consent.

    • User Control: It's crucial for users to review and adjust their privacy settings to ensure that sensitive information remains secure.
    • Alternatives for Enhanced Privacy: The discussion highlights alternatives like end-to-end encrypted cloud storage solutions to maintain data privacy.
    • Relevant Article: Read more about it on Ars Technica.
  • Encrypted Cloud Storage Solutions

    To address privacy concerns with cloud storage, the hosts explore various encrypted storage options:

    • Cryptomator: An open-source tool that provides client-side encryption for cloud storage, ensuring that only users can access their data. Visit Cryptomator for more information.
    • Proton Drive: Offers secure, encrypted cloud storage with user-controlled encryption keys, suitable for sensitive documents. Check out Proton Drive with a discount code.
    • Sync.com: Provides end-to-end encrypted storage with a focus on simplicity and security. Learn more at Sync.com.
    • Nextcloud: A self-hosted solution for those seeking more control, though recent vulnerabilities like ownCloud’s CVE-2023-49103 raise security concerns.
    • IceDrive: The next generation of cloud storage with encryption. Visit IceDrive.
    • Filestream: Explore at filen.io.

    These solutions empower users to safeguard their data against unauthorized access, even when using third-party cloud services.

  • Digital Decluttering and AI Feature Concerns

    The hosts express concerns about the increasing integration of AI features into various tools, questioning the allocation of development time towards adding mediocre AI functionalities instead of improving core features. Additionally, there's a focus on personal digital decluttering to enhance productivity and security.

  • Keynote at PyCon Philippines 2024

    Michael Kennedy shares his excitement about delivering the keynote at PyCon Philippines 2024 in February. This opportunity allows him to engage with the local Python community and share insights from the year's discussions, further strengthening the global Python network.

Quotes and Stories

  • On Hatch's Evolution:

    "Hatch has gone in that direction of now Hatch manages Python, not just Python projects. And there's this thing to solve this problem in the form of PyApp." — Michael Kennedy

  • On svcs Benefits:

    “svcs (pronounced services) is a dependency container for Python. It gives you a central place to register factories for types/interfaces and then imperatively acquire instances of those types with automatic cleanup and health checks.” — Brian Okken

  • Domain Renewal Anecdote:

    "So I had about eight that I was not really using last year... Somebody could have paid you $5,000, but they instead got it for like 20 bucks or something." — Michael Kennedy

Overall Takeaway

The Python Bytes Crossover 2023 episode serves as a comprehensive wrap-up of the year’s advancements and community developments in the Python ecosystem. From the enhanced capabilities of Hatch and the innovative service locator tool svcs to the election of new Python Steering Council members, listeners gain valuable insights into the tools and governance shaping Python’s future. The discussion on Python protocols underscores the language’s commitment to flexibility and type safety, while conversations around encrypted cloud storage emphasize the community’s dedication to data privacy and security. Additionally, the episode highlights the importance of community engagement through platforms like Mastodon and addresses contemporary concerns regarding AI integration in development tools. Celebrating both technical advancements and the vibrant Python community, this episode inspires developers and data scientists to continue building, contributing, and safeguarding their projects within the ecosystem.

Relevant Links

Episode Transcript

Collapse transcript

00:00 This episode is a special crossover from my Python Bytes podcast that I co-host with Brian

00:04 Aukin.

00:04 It's got a different vibe than the interview shows here and short topics coming in fast

00:10 and quick.

00:11 If you haven't listened before, I think you're going to enjoy it.

00:13 So here are a bunch of excellent Python tips and tools to close out the year.

00:18 See you all in the first week of January.

00:21 And while I'm talking directly to you, thank you very, very much for taking the time to

00:26 listen to my shows and support all of my projects.

00:28 Cheers.

00:30 This is Talk Python to Me, sort of.

00:32 Episode 443, recorded December 19th, 2023.

00:37 Welcome to Talk Python to Me, a weekly podcast on Python.

00:54 This is your host, Michael Kennedy.

00:56 Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython,

01:01 both on fosstodon.org.

01:03 Keep up with the show and listen to over seven years of past episodes at talkpython.fm.

01:09 We've started streaming most of our episodes live on YouTube.

01:12 Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming

01:18 shows and be part of that episode.

01:20 This episode is sponsored by Posit Connect from the makers of Shiny.

01:24 Publish, share, and deploy all of your data projects that you're creating using Python.

01:29 Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quattro, Reports, Dashboards, and APIs.

01:35 Posit Connect supports all of them.

01:38 Try Posit Connect for free by going to talkpython.fm/posit.

01:42 P-O-S-I-T.

01:43 And it's also brought to you by us over at Talk Python Training.

01:48 Did you know that we have over 250 hours of Python courses?

01:52 Yeah, that's right.

01:54 Check them out at talkpython.fm/courses.

01:57 Hello, and welcome to Python Bytes, where we deliver Python news and headlines directly

02:01 to your earbuds.

02:02 This is episode 365.

02:05 Wow.

02:06 Recorded.

02:07 It's like we've been doing it for a year.

02:08 Yeah.

02:09 Recorded December 19th, 2023.

02:13 Yeah.

02:14 And I'm Brian Okken.

02:15 Hey, I'm Michael Kennedy.

02:16 And yeah, if we did it, if somebody listened to one a day from now on, they would be behind

02:23 because we'll be way ahead of 365 by the time they finish.

02:27 But yeah.

02:27 Still be awesome.

02:30 Well, want to kick us off with something cool?

02:34 Oh, before we kick it off.

02:35 Yeah, go ahead.

02:36 Let's say that this episode is sponsored by us.

02:39 So please support us and other people.

02:42 I'm going to talk about that a little bit later at the end of the show.

02:45 But also check out all the courses at Talk Python Training.

02:50 Check out the Complete pytest course.

02:52 You can be a Patreon supporter.

02:54 And also, if you want to connect with us, one of the best ways to do it is through on

02:58 Mastodon.

02:59 And we're all on Fosstodon, or at least Michael and I are.

03:03 At M.

03:04 Kennedy, at Brian Okken, and at Python Bytes.

03:07 Indeed.

03:08 Hey, do I feel like I'm really fast, Brian?

03:12 Like Neo in the Matrix?

03:13 Mind-bendingly fast?

03:15 Let's go with yes.

03:17 Okay.

03:18 I appreciate that.

03:19 Because I just got fiber, gigabit fiber installed 30 minutes ago.

03:24 I was hoping it wouldn't destroy the show, but it almost didn't make it, but it made it.

03:28 Ooh, nice.

03:29 So hopefully that doesn't curse it, that something doesn't go wrong and it will crash.

03:32 But 950 megabit down, which is fine, but 950 megabit up is glorious.

03:37 We should speed up the playback speed when we release the MP3 so it sounds really fast.

03:43 No, we're talking really fast because it's really uploading.

03:45 Yeah.

03:45 No, let's talk about Hatch, because Hatch is awesome.

03:49 OFEC is the maintainer-creator of Hatch, and boy, oh boy, has he gone big on his latest release,

03:56 1.8.0.

03:57 So Hatch is like Flit, is like PDM, is like PIP, ENV, and many of these other poetry, others.

04:05 If I'm leaving your version of this out, I apologize.

04:08 But with version 1.8, this has gone in a bit of a different direction.

04:15 You know, I had OFEC on the Python packaging panel.

04:19 I think Steve Dower was there.

04:20 Some other folks were there.

04:22 Really interesting that there's this tension between should there be an app that manages

04:28 Python environments with Python, or should there be a thing that manages the Python itself,

04:34 right?

04:35 Kind of like PyEMV, for example, right?

04:38 So Hatch has gone in that direction of now Hatch manages Python, not just Python projects.

04:45 And there's this thing to solve this problem in the form of PyApp.

04:50 So PyApp is even maybe more awesome.

04:53 PyApp is a runtime installer for Python projects written in Rust, and they can be, you ready

05:00 for this?

05:00 I'm so, so excited.

05:02 Your Python app can be distributed as a standalone executable, a .exe or .app for users.

05:09 What do you think, Brian?

05:10 I'm very interested in finding out more.

05:12 Now, this whole post is a little bit wordy.

05:15 So let me jump into the omnivore version of it over here, which has a huge icon.

05:20 So Ofex says, look, one of the things that's been a perpetual problem for Hatch and all the

05:25 others I named is that Python itself is a dependency.

05:27 So in order to use Hatch or any of these other tools or any apps, you have to say, well, go

05:32 get Python and then get back to me and we'll start talking, right?

05:35 So he came up with this thing called PyApp that will create installers for the different

05:40 platforms.

05:40 Claims it's trivial.

05:41 It's probably never trivial, but possible.

05:44 Possible would be awesome even.

05:46 And so starting with this releases, not only are the binaries available for every platform,

05:52 but there are installers as in like install wizards on Windows and a DMG type thing, I'm

05:59 guessing, or a PKG on macOS.

06:01 But so the installer for the macOS is signed using the certificate from the same account used

06:06 to sign the official distributions of Python.

06:08 So you won't get any security warnings or blocking.

06:10 Thank you, Ederbin, for helping out with that.

06:13 And Hatch itself with any good system is self-updating.

06:16 So you can Hatch self-update.

06:18 What else I want to point out?

06:19 There's also a new Python, like Hatch space Python command group that will allow you to

06:24 manage things.

06:25 So you can show what you have installed.

06:27 You can install different versions of Python, CPython and PyPy for those.

06:32 Works with virtual environments.

06:34 It has built in rough and Ruff format integrations.

06:38 Traditionally, it's been somewhat slow to like activate and set up a virtual environment

06:45 that's already previously been installed because it'll refresh and recheck that all of the

06:50 dependencies are there and everything.

06:52 So now it does a hash of those.

06:54 And so only if the dependency statement doesn't match the hash, right?

06:59 Basically, so it'll pre-compute all that stuff.

07:00 So now it should be basically instant.

07:03 So also some minor breaking changes around build defaults and the new app build targets,

07:09 what I've been raving about.

07:10 So OFAC, you killed it.

07:12 Can't believe it.

07:12 It's awesome.

07:13 Awesome.

07:13 So Hatch has hashes?

07:16 If you hash a hatch with hashling and, you know, like there's some kind of tongue twister

07:24 in there we could do.

07:24 I'm not doing it though.

07:25 Got to be.

07:27 I'm excited about this.

07:28 It's very cool.

07:29 I definitely want to play with it.

07:31 Yeah.

07:31 Yes, indeed.

07:32 This portion of Talk Python to Me is brought to you by Posit, the makers of Shiny, formerly

07:37 RStudio and especially Shiny for Python.

07:40 Let me ask you a question.

07:42 Are you building awesome things?

07:44 Of course you are.

07:45 You're a developer or a data scientist.

07:47 That's what we do.

07:47 And you should check out Posit Connect.

07:50 Posit Connect is a way for you to publish, share and deploy all the data products that you're

07:55 building using Python.

07:56 People ask me the same question all the time.

08:00 Michael, I have some cool data science project or notebook that I built.

08:03 How do I share it with my users, stakeholders, teammates?

08:06 Do I need to learn FastAPI or Flask or maybe Vue or React.js?

08:11 Hold on now.

08:12 Those are cool technologies and I'm sure you'd benefit from them, but maybe stay focused on

08:16 the data project.

08:17 Let Posit Connect handle that side of things.

08:19 With Posit Connect, you can rapidly and securely deploy the things you build in Python.

08:25 Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quattro, Reports, Dashboards, and APIs.

08:31 Posit Connect supports all of them.

08:33 And Posit Connect comes with all the bells and whistles to satisfy IT and other enterprise

08:38 requirements.

08:39 Make deployment the easiest step in your workflow with Posit Connect.

08:43 For a limited time, you can try Posit Connect for free for three months by going to talkpython.fm

08:48 slash posit.

08:50 That's talkpython.fm/P-O-S-I-T.

08:53 The link is in your podcast player show notes.

08:55 Thank you to the team at Posit for supporting Talk Python.

09:00 I'm not sure how long this has been out, but Hinnick has been promoting a new project that

09:08 he's got called Services or SVCS, which is short for Services and pronounced services.

09:15 And it is a, I think it could be used for more than web stuff.

09:19 But the intent, I think, was for removing some labor plate code from hooking up dependencies

09:27 and different, like your database and your cache and all sorts of stuff to an application.

09:34 Typically a web application, but I think it could really be anything.

09:38 But it's a flexible service locator.

09:41 And one of the reasons why I haven't covered it yet on Python Bytes, I don't think I have,

09:47 is because I didn't quite understand what it was doing.

09:51 And it took me a while to get my head around it.

09:53 Why does this exist?

09:53 But it's pretty cool.

09:56 And Hinnick apparently realizes that it is a bit difficult to get your head around what this

10:01 is doing.

10:02 So he just recently released a video describing this project.

10:08 So really great video describing services, what you can do with it, and also how to pronounce

10:16 his name.

10:17 He doesn't pronounce his last name, though.

10:19 Apparently that's left for maybe episode two.

10:22 But Shalavak, I guess.

10:25 Anyway, it's pretty cool.

10:28 Actually, I'm pretty excited about it after watching it.

10:31 Watching the video.

10:33 I thought maybe it wouldn't be for me.

10:35 But especially for keeping services contained or the setting up services, looking them up

10:42 within different parts of your application, and then getting them all cleaned up correctly

10:48 at the end.

10:48 That's kind of what it does, plus a whole bunch of other stuff.

10:51 And one of the neat things is throughout all of this documentation, the documentation is

10:55 amazing.

10:56 Throughout all of this documentation, he has examples in AIo HTTP, FastAPI, Flask, Pyramid,

11:04 and Starlet.

11:04 Nice.

11:05 And the video is talking about Flask, but it's cool that he just already hit all the bases.

11:11 Like, how do I do this in Starlet?

11:13 Well, it's just a little different.

11:15 Most of them, mostly they're similar, but little different ways to use it throughout the different

11:21 applications.

11:22 So it's pretty cool.

11:23 He also mentions in the video that he took a really long time really talking about the terminology

11:30 and the glossary of the documentation.

11:33 And actually, I really appreciate this of somebody saying, okay, this is generally what I think

11:39 of as what the meanings for all of these words are.

11:43 And a lot of these words are overused in the English language to begin with, and even in talking

11:50 about programming, web programming.

11:51 But things like, what is a service?

11:53 What is a resource?

11:54 What is a dependency?

11:55 Service layer.

11:57 He goes through a whole bunch of different terms, what it means to him and probably to everybody

12:02 else, but if you're unfamiliar with him.

12:04 And even a decent discussion of dependency injection.

12:07 So one of the things he talks about is that this is not really a dependency injection thing.

12:13 It's inversion of control, but it's a little different than service.

12:17 Service locators are a little different than dependency injection.

12:20 And I kind of appreciate that discussion.

12:23 It's pretty cool.

12:23 So anyway, kudos to Hinnick for doing this and for helping us pronounce his name.

12:29 Yeah, this looks cool.

12:31 I definitely want to check this out.

12:32 It's news to me, so I will be checking it out.

12:34 Cool.

12:35 Mm-hmm.

12:35 We have new leaders, Brian.

12:39 We do.

12:40 Yes.

12:40 For the Python world, we have new leaders.

12:42 And specifically, the steering council election results are in for next year.

12:48 Okay.

12:48 So for the 2024 term, we have Pablo Galindo Salgado.

12:53 We've got Gregory Smith, Emily Morehouse, Barry Warsaw, and Thomas Waters.

12:57 So very cool to see them all leading the way.

13:02 There's a lot of familiar faces there.

13:04 So that's pretty cool.

13:05 I don't expect a whole lot of different from the year before, but here's the results.

13:10 You can actually see in PEP 8105, you see everybody who was potentially a candidate, how many votes

13:19 they got by people who are disenfranchised.

13:21 I don't know what that means.

13:22 Or the franchised voters, the one who are enfranchised, how many votes that they got.

13:28 And you can put that all together.

13:29 So this begs the question, like, well, how do you get on this list?

13:33 You get on this list by being nominated by a core developer.

13:37 So everyone on the list was nominated by a core developer.

13:39 If you are a core developer, you can nominate yourself.

13:44 So that could be the person you see here, because everyone I see, I think, is a core developer.

13:49 Okay.

13:49 But anyway, the results, the results are in, and we have those five folks.

13:54 Welcome and congrats.

13:55 Awesome.

13:55 Nice.

13:56 That's a good set of names, too.

13:58 Yeah.

13:58 So.

13:59 Yeah.

13:59 All right.

14:00 Indeed.

14:01 Well, there probably is some protocol around the election results, right?

14:07 No, you could model it with classes, or you could functionally model it, like, in an immutable

14:12 way, but I don't know about a protocol.

14:14 Okay.

14:14 We're just great at transitions on this podcast.

14:19 The next I want to talk about Python protocols.

14:22 So there's an article from Carlos Vecina, I think, called Python protocols, defining a protocol

14:31 and when to use it.

14:32 And actually, this is something that I have, I've been meaning to play with for actually

14:37 some years, and I haven't really done much with it yet.

14:40 So I really appreciate this article.

14:41 He's talking about protocols are a feature of Python that were added in Python 3.8.

14:48 So really anything maintainable right now, you can use protocols.

14:54 And you kind of, mentally, I think of them kind of like class inheritance or mix-ins or abstract

15:03 base classes.

15:04 And that's one of the things he talks about in this article is they are in that same similar

15:10 space, but you use them a little different.

15:13 And you might use them together with other forms too, like with mix-ins and abstract base

15:18 classes.

15:19 So the article just goes through on how to define a protocol.

15:23 And really, and he's also discussed also a decent tutorial on abstract base classes and mix-ins

15:29 as well, which is nice to kind of describe them all together.

15:32 But the protocol thing is just sort of, let me see if I can find an example.

15:37 So you inherit, you have a class that's inherited from protocol and you give it, you kind of give

15:44 it function definitions, but don't fill in the body.

15:47 So that's kind of what a protocol is.

15:49 And then other classes that use the protocol derive from that protocol.

15:56 From like in his example, there's a class called explainable, something that has an explained

16:02 function.

16:02 And so you would derive from explainable and then your new class would be a instance of

16:11 a protocol.

16:11 But all it really says is that you can, other places that use it for types and stuff can

16:16 declare that they need a protocol passed in or a explainable class.

16:21 And then you can use anything that derives from that.

16:23 So pretty cool.

16:24 Yeah, Brian, let me jump in and just say one extra point here.

16:28 Like what's awesome about this stuff is we've had duck typing like this.

16:33 There's an assess fairness function that it has to call explain on the object passed in.

16:38 And duck typing said, well, if it takes that, if you can pass it in there and it will run

16:42 when you call explain on it, it must fit.

16:44 Right.

16:44 But the typing tools don't check.

16:46 So like PyCharm, for example, would just go, well, it's a whatever.

16:49 So good luck with that.

16:50 But once you do this protocol stuff, if you say the function takes an explainable and you

16:55 have explainable as a protocol, you can pass stuff in and it doesn't even have to derive

17:00 from or be related to that protocol in a base class.

17:03 Like anything that is passed in there, the type system will look at it and verify it hasn't

17:08 explained, even if it's in a third party package and you don't control it.

17:11 So it's like a way to project typing structure onto a dynamic thing that is not necessarily

17:16 your code.

17:17 It's wild.

17:17 Oh, cool.

17:18 I kind of had that a little bit wrong then.

17:20 Awesome.

17:21 You can drive from it.

17:22 It gives you more information potentially, but.

17:24 It doesn't have to be.

17:25 You don't even have to, which that's the totally wild aspect.

17:28 That's what I think is really different for this.

17:30 Okay.

17:30 Yeah.

17:31 Oh, awesome.

17:32 That's pretty cool.

17:33 No.

17:33 Yeah.

17:34 So clearly I haven't thoroughly read this article, but I do want to get into really getting my

17:40 head around abstract based classes, mix ins and protocols and stuff.

17:43 And partly.

17:44 I wouldn't say that though, because like your experiences in C++, mine also is in C++ and C

17:49 sharp and all of those languages have these interface ideas, but there's, they're, they're put

17:53 into the type system through inheritance.

17:55 And so you can inherit from it and it does what you expect.

17:57 And it seems the right thing, but what's weird is you don't even have to.

18:00 That's what's weird about it.

18:01 Okay.

18:02 Cool.

18:02 Oh, awesome.

18:03 Ah, now I definitely want to play with it more.

18:05 yeah.

18:06 Cause I've kind of missed that aspect of C++ in Python.

18:09 Yeah.

18:10 so nice.

18:11 Anyway, also, I'm assuming it's a AI generated image, but really cool image at the top of the

18:18 article.

18:19 It's good.

18:19 I don't, I'm not sure what my opinion is about it.

18:21 I'll ask ChatGPT, how I feel about it.

18:23 It's hard to describe how I feel.

18:25 So I'll, you know, yeah, I'm actually sort of, I don't know, this is a tangent, but I've

18:31 switched to, was, was playing with like Bing is my primary search engine at work.

18:37 I just, I don't know that a new computer, it just was there and I'm just going with it for

18:41 a while, but everything I search is like, it gives me an AI generated answer first.

18:45 And I'm like, I don't, I don't know if I like that very much.

18:49 Yeah, I know.

18:50 I know.

18:50 Anyway, well, that's, that's it for our main stuff.

18:53 Do you have any extras?

18:55 I could have almost made it an extra, extra, extra this time.

18:58 So yeah, sure.

18:58 I do.

18:58 First of all, I've been wanting to say this several times and I'm usually like looking at

19:03 my screen and see what I want to share and stuff.

19:05 And I didn't have this anywhere.

19:06 So I just pulled up Mastodon to remind me there are tons of people interacting with us

19:11 over on Mastodon.

19:12 And I've had some great conversations and I want to, I'm sure you do too, Brian, want to

19:16 follow people back, but there's, there's kind of a, at least for, I'll say these are Michael's

19:21 Mastodon's conventions.

19:23 you, you could take them for what you want.

19:25 I just made them up, but this is how I think about it.

19:27 So people will follow me and I'm like, huh, did that person follow me?

19:30 Cause they listened to the show and listened to Brian say, you should come join us and have

19:33 a conversation.

19:33 Hey, I'd like to follow that person.

19:35 But a lot of times they have no picture, no description, no web pages, no posts.

19:39 You're like, yeah, maybe not next, you know?

19:42 And so I'm just going to say, if you have a picture and a description, a description seems

19:47 somewhat relevant.

19:47 I will certainly follow you back.

19:49 If you have posts, that's plus one.

19:51 If you have a verified webpage, which is easy, another plus one.

19:54 And a lot of people have private accounts who follow me.

19:57 I'm like, why are you in social media?

19:59 If you want a private account?

20:00 I don't understand what this is because your profile is public.

20:03 Just your posts are private, but the platform has a way to have private posts.

20:07 I don't understand.

20:08 So anyway, probably not going to get a lot of engagement.

20:11 If you have a private account, just post private messages for things you don't want to see.

20:15 So, and while I'm on the topic of Mastodon, I had a really nice and productive conversation

20:20 with the PSF around my mask rant on PyCon.

20:23 So that was nice over there.

20:25 Some people weren't nice as they sent me, like not necessarily nice responses, but the PSF

20:29 did.

20:29 And that was cool.

20:30 That's nice.

20:30 Yeah.

20:31 All right.

20:31 Next one.

20:32 Oh, wait.

20:33 Before you move on, I just want to add my two cents on the, the picture.

20:38 I also prefer to be able to see who it is, but also primarily if the picture is something

20:44 that they're using on other stuff.

20:45 So like if a lot of people have a, their profile picture on their, like the profile picture on

20:50 their blog and on their, and in their primarily a GitHub user and, and they have the

20:56 same profile there, even if it's like a stylized something, but if it's the, if it's distinctive

21:02 and the same everywhere, like glyph, for instance, has a, has a different thing for them.

21:07 I I'm okay with that, but most people I think go with their picture.

21:11 I think it's the right answer.

21:12 But yeah, when I say picture, I don't mean necessarily it has to be your picture.

21:16 Just the fact that it's not the default icon.

21:18 You've taken enough effort to put in something, even if it's just a picture of a triangle, I don't

21:23 care.

21:23 You know?

21:24 Yeah.

21:25 All right.

21:26 Paul is asking in the audience, what is your secret?

21:29 Okay, well, we'll do this.

21:33 we, earlier on, we were talking about how Michael's got a faster internet now, so we

21:39 should make it really fast speed.

21:41 and then somebody commented, wagrants, wagrants, commented, I played it at one and a half

21:47 times speed.

21:47 Then I got up to a live event.

21:50 and all of a sudden Brian should sounded like he got drunk in one second.

21:55 and so I said, Brian's secret is out.

21:59 So nice.

21:59 I'll just have another drink of my, Irish coffee.

22:03 It's coffee.

22:03 Trust me.

22:04 All right.

22:06 more extras.

22:08 So, Dropbox spooks users with turning on new AI features that can almost automatically

22:15 send your private documents to open AI.

22:18 Now you have to interact with part of the site for it to happen, but it doesn't say, Hey,

22:22 necessarily, cause you does, you touch this.

22:24 We're now sending your social security number away.

22:27 but anyway, that's kind of unnerving.

22:31 Yeah.

22:31 Yeah.

22:32 So you can check that out on defaulted to on if you're not subject to the GDPR, but defaulted

22:38 to off if you are.

22:40 So, you know, plus one for GDPR there, I suppose.

22:43 So mine was turned on.

22:44 Okay.

22:44 So you have to go check to make sure that they're not sharing all of your.

22:47 Yes, exactly.

22:49 And it's on by default for you, Brian.

22:50 So you might want to check the whole conversation.

22:54 It's on ours.

22:55 The, the, the comment section of our second is like the top notch place for comments, I

23:00 think.

23:00 So really good.

23:01 Okay.

23:02 Yeah.

23:03 There's, it talks about how to go find it.

23:04 So anyway, this like maybe think, you know what?

23:06 I should really be a little more.

23:07 I have, I have like three terabytes of data and Dropbox.

23:10 So I'm like, maybe I should be a little more specific and intentional about where I put

23:14 my stuff.

23:14 So I went on this, this ran on Mastodon, by the way, a bunch of people sent me all sorts

23:17 of options of like, okay, if not Dropbox, then what?

23:20 And I decided whatever I'm doing is probably good to have it end to end encrypted.

23:25 Cause then I don't care what they try to do with it.

23:27 Right.

23:27 Cause they can't decrypt it.

23:29 Yeah.

23:29 That, that solves a whole lot of problems.

23:31 You care about the security, but it doesn't matter as much as if you're just exposing files

23:36 or leaking stuff or whatever.

23:38 Right.

23:38 So I decided to go, I already have a paid Proton account.

23:43 So all my private stuff, all my private documents, like my scans of things I want to save that might

23:48 be sensitive.

23:48 They're going to Proton drive.

23:50 I have 500 gigs and it's already paid for and encrypted.

23:54 There's async thing you can install.

23:56 That's pretty excellent.

23:57 I looked around and some people suggested next cloud, which is really interesting.

24:02 It's maybe more than I want.

24:03 It's almost like a document calendar, everything self-hosted.

24:07 Maybe do that next.

24:08 Yeah.

24:09 Own cloud got like super owned just last week.

24:13 And there's a similar self-hosted thing, which makes me a little nervous to self-host stuff.

24:16 I know there are people who host it for you, but it's not next cloud.

24:19 It's a little bit indirect.

24:21 So maybe violin.

24:22 I don't know if you've heard of this, but they have encrypted cloud storage and the end again,

24:29 pretty nice.

24:30 I think this is British.

24:32 I don't remember exactly.

24:33 UG.

24:34 Not sure.

24:35 But somewhere in Europe, this company, it looks pretty good.

24:39 I have not tried it, but in encrypted.

24:42 There's IceDrive, the next generation cloud storage.

24:44 Also, I think this might be the British one.

24:46 Yeah, this is in Wales.

24:47 I mean, British, I mean, UK.

24:49 Sorry, folks.

24:49 So that's pretty interesting.

24:51 And I think I'm going to go with sync.com.

24:55 Super simple.

24:56 All they do is sync and then encrypted for six terabytes.

25:00 It's like 140 bucks a year or something like that, which is a lot versus 240 for less than

25:05 that in Dropbox.

25:05 Anyway, if people are in this zone of like, I'm looking for all this stuff.

25:09 Oh my gosh.

25:10 Like, what am I going to do?

25:11 Regardless of whether you care about the Dropbox fiasco.

25:14 Here's a bunch of options people can pick.

25:16 There was one comment in this whole discussion that was pretty interesting.

25:19 I think it was in the Ars Technica thing.

25:23 And it said, look, if you give your data unencrypted to somebody, another company, even if you trust them, you don't really necessarily control that anymore,

25:30 especially if they decide to pass it along.

25:32 So somebody pointed out Cryptometer.

25:35 Have you heard of this, Brian?

25:36 No.

25:37 Cryptometer is cool.

25:38 I have used something like it, but it's older and no longer supported, which makes me sad.

25:42 So what you do is you run this app.

25:45 It does like super strong encryption.

25:47 You control the key, right?

25:48 It's just like a thing you make up and don't give away.

25:50 And then it will create a drive, a mountable drive on your Mac or on Windows,

25:56 like a D drive or E drive or whatever.

25:58 And that thing is encrypted.

25:59 So when you mount it with this software, it looks like a drive.

26:02 But then when you unmount it, it becomes just an encrypted pile of files.

26:05 So you put that in Dropbox, you put that in sync or whatever.

26:09 And then no matter what happens, they just get an encrypted blob of stuff.

26:12 So things I super care about.

26:14 I have encrypted in something, either Cryptometer or something like it, on top of all the safety around the cloud drive and trust and whatever you might have there.

26:22 Like worst case scenario, they get a huge, hard, hard to decrypt a blob of stuff that they don't know the value of.

26:28 And I don't know if it has Linux.

26:29 Someone's asking, does it have Linux?

26:30 I think it might.

26:33 Let's see.

26:34 Mac.

26:35 Let's see if I go to download what it says.

26:37 Yeah.

26:38 Worth knowing for people.

26:39 Downloads.

26:40 Use your DMG.

26:41 Yeah.

26:42 Windows, Mac, Linux, Android, and iOS even.

26:45 Yeah.

26:46 So that's that.

26:47 I think that it's a loss.

26:49 I mean, cool.

26:50 But Cryptomator would have been great as a rotten tomato sort of thing to rate different cryptocurrencies.

26:57 I know.

26:58 It's the word is taken.

27:01 I'm pretty sure this has been around before crypto became a thing.

27:05 Like, I'm not sure how old this is, but yeah, there's 17 pages of releases on GitHub from 2017.

27:12 So yeah, they were ahead of their time in that.

27:14 But yeah, this is super cool, Brian.

27:16 Like you can just say, I don't really care that much about the security where these files go.

27:20 You're not getting them.

27:21 Interesting.

27:22 So I suggest a sweet combination of these things.

27:25 I'm going through like a super digital decluttering as part of this, and it's glorious.

27:30 I'm having like a tech love affair with Notion.

27:33 It's so good.

27:33 But yeah, anyway, I'll leave it there.

27:37 Maybe I'll come back and tell you more about this.

27:39 Last thing for me, I'm doing the keynote at PyCon Philippines 2024 in February.

27:46 How awesome is that?

27:47 Slightly jealous, man.

27:49 Somewhere I scroll down and over.

27:51 Woo.

27:52 Yeah.

27:53 Cool.

27:53 Three of us, and I get to be one of them.

27:55 So that'll be awesome.

27:55 Thank you for inviting me.

27:57 And if you're going to be there, I will see you there.

27:58 Nice.

27:59 Yeah, in February.

28:00 Cool.

28:00 Oops.

28:01 Over to you for your extras.

28:03 Well, I just deleted one.

28:05 So sorry about that.

28:06 But shift command T.

28:09 Oh, shift commit.

28:12 Whatever.

28:12 I'll just tell you guys about it.

28:14 So this is the kind of time of year that some people like to donate some money to different people.

28:22 different groups.

28:23 I had the link up for the Python Software Foundation.

28:27 So Python Software Foundation is not hard to find.

28:31 So I would encourage people to consider giving some money to the PSF.

28:36 So Django Software Foundation is doing a drive.

28:39 So giving some money.

28:41 If you use Django, of course.

28:42 If you enjoy Python Bytes, of course, you can check out Patreon.

28:46 At Patreon, we do accept money for Python Bytes to help keep the show going.

28:53 This is great.

28:54 Also, I wanted to highlight as well just the idea that to just go on GitHub.

29:01 So the different things you use on GitHub.

29:03 Like adders, for instance, you can go down and you can sponsor this project.

29:08 You can throw some money that way.

29:10 pytest has a sponsor link.

29:14 Palettes and Flask has a way to sponsor either all of Palettes or particular projects within the Palettes program.

29:22 And really, a lot of projects that you use every day have a sponsor of this project on GitHub.

29:30 So I think it'd be great, too, for people.

29:32 If you have extra and you want to help out, I think it's a good idea.

29:35 Sometimes I help out different projects.

29:38 And I kind of shift it up every year in local things.

29:41 And I think the things that I use.

29:44 And somebody asked me once recently about some projects don't really need the money.

29:50 And I guess, for instance, I really love having people support Python Bytes through Patreon.

29:56 It's fun to have our community help support us.

30:00 If you, in particular, don't donate, we're not going to disappear.

30:04 Michael and I are going to keep doing it anyway.

30:06 It is totally up to you.

30:07 And definitely don't do it if it's a hardship.

30:09 But I think it's a fun thing to do this time of year is to spread the love around.

30:14 That's all I wanted to say.

30:15 Indeed, I second that as well.

30:19 That's kind of serious, though.

30:21 Do you have something funny for us?

30:23 Let's lighten it up.

30:24 No, this is not funny.

30:25 It's too close to home.

30:27 You told me how you feel about this.

30:28 So here's the joke.

30:29 Here's the joke.

30:30 So there's two red buttons.

30:31 Think Ren and Stimpy or something like that.

30:33 And a huge, scary red button.

30:35 You can press either of them.

30:36 One of them says, pay $12.

30:38 The other one says, admit to yourself, your dream is dead.

30:42 And at the bottom, there's somebody sweating trying to decide which button to press.

30:46 And it's the domain renewal.

30:49 Oh, yeah.

30:49 Totally.

30:49 Totally.

30:50 This is way too close to home for me because I just transferred 25 domains from all the different

30:58 places into hovers I talked about like a while ago.

31:00 And I talked about all the name servers and all that.

31:04 And there was a few where I'm like, God, is the dream dead or do I just move this?

31:07 So how many are you using still out of those?

31:11 Well, lots of them are to like protect people from doing crappy stuff.

31:15 For example, I've talked by thon.com.

31:17 I don't technically use it.

31:19 It redirects to talk by thon.fm.

31:21 But if I don't have it, someone will get it.

31:24 And then all sorts of badness.

31:25 Like there's a bunch of these guards.

31:27 I would say half of them fall into that realm.

31:28 Okay.

31:29 And then maybe another third I'm directly using.

31:31 And then there's the whatever the balance, the one sixth that's left is the dream could

31:35 be dead.

31:36 But or it could be not there yet.

31:38 Not realized yet.

31:38 We'll see.

31:39 I had about eight that I was not really using last year.

31:44 And I admitted that about half of those are not going to go anywhere and let them expire.

31:51 Although I mean, the domain companies don't make it easy.

31:54 You're like, okay, I'm just going to let it expire.

31:57 But you get like emails.

31:58 No, it's going to go.

32:00 Oh, it's gone.

32:01 But we're going to save it for you for a couple more months.

32:04 And you get a whole bunch of guilt emails.

32:06 But yeah.

32:07 Anyway.

32:08 Yeah.

32:08 Yeah, exactly.

32:09 I have one real quick sad story to round this out, Brian.

32:12 A friend of mine and I decided we're going to write some iPhone apps right when the iPhone

32:16 came out, like 2007 or whatever it was.

32:19 And he had the clever idea of like, let's go.

32:21 Let's get a domain.

32:21 I would probably do it together.

32:22 I don't know.

32:23 Got the domain.

32:24 iPhone dot L Y.

32:26 I fun.

32:26 Lee.

32:26 And we worked on stuff for like a year because we didn't know we're going to build.

32:30 We'll just like come up with this.

32:31 We'll put stuff there.

32:32 Never really came up with stuff.

32:34 It looked like there was nothing on the horizon.

32:35 We're like, you know, after three years, the L Y is like the FM.

32:37 I was like kind of expensive.

32:39 Like, ah, just let it go.

32:40 A week later, somebody says, Hey, I'll give you $5,000 for that domain.

32:43 So I shoot my friend like, Hey, don't let it expire yet.

32:45 Let's do this instead.

32:46 He's like, it expired last week.

32:48 Like, no.

32:48 Oh no.

32:49 Oh well.

32:51 So it goes.

32:52 So that somebody could have paid you $5,000, but they instead got it for like 20 or got it.

32:57 Yeah.

32:57 For like 20 bucks or something.

33:00 I'm sorry to laugh at your pain.

33:02 No, it's okay.

33:03 I mean, like I'm telling you, this is not a joke.

33:05 Admit to yourself, your dream is dead or pay $12 for the rest of your life every year.

33:09 That's where you are.

33:11 No, it's good.

33:13 It's a good joke and people can hopefully laugh at it.

33:16 Yeah.

33:16 Everybody.

33:17 Most people that listen to this podcast probably are feeling this.

33:20 Yeah.

33:22 All right.

33:22 All right.

33:22 Well, I'm feeling good about our year's worth of show every day.

33:26 Yeah.

33:26 365.

33:27 Pretty cool.

33:28 Yeah.

33:29 All right.

33:29 Talk to you later.

33:30 Yeah.

33:30 See you.

33:31 Thanks everyone.

33:32 This has been another episode of Talk Python to Me.

33:36 Thank you to our sponsors.

33:38 Be sure to check out what they're offering.

33:39 It really helps support the show.

33:41 This episode is sponsored by Posit Connect from the makers of Shiny.

33:45 Publish, share, and deploy all of your data projects that you're creating using Python.

33:49 Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quattro, Reports, Dashboards, and APIs.

33:57 Posit Connect supports all of them.

33:58 Try Posit Connect for free by going to talkpython.fm/posit, P-O-S-I-T.

34:04 Want to level up your Python?

34:05 We have one of the largest catalogs of Python video courses over at Talk Python.

34:09 Our content ranges from true beginners to deeply advanced topics like memory and async.

34:15 And best of all, there's not a subscription in sight.

34:17 Check it out for yourself at training.talkpython.fm.

34:20 Be sure to subscribe to the show, open your favorite podcast app, and search for Python.

34:25 We should be right at the top.

34:26 You can also find the iTunes feed at /itunes, the Google Play feed at /play,

34:31 and the direct RSS feed at /rss on talkpython.fm.

34:36 We're live streaming most of our recordings these days.

34:39 If you want to be part of the show and have your comments featured on the air,

34:42 be sure to subscribe to our YouTube channel at talkpython.fm/youtube.

34:46 This is your host, Michael Kennedy.

34:49 Thanks so much for listening.

34:50 I really appreciate it.

34:51 Now get out there and write some Python code.

34:53 Now get out there and write some Python code.

34:53 I'll see you next time.

34:53 Bye.

34:54 Bye.

34:54 Bye.

34:54 Bye.

34:54 Bye.

34:54 Bye.

34:54 We'll see you next time.

Talk Python's Mastodon Michael Kennedy's Mastodon