Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book

#298: "Unstoppable" Python

Published Wed, Aug 24, 2022, recorded Tue, Aug 23, 2022
Watch this episode on YouTube
Play on YouTube
Watch the live stream replay

About the show

Sponsored by Microsoft for Startups Founders Hub.

Brian #1: Uncommon Uses of Python in Commonly Used Libraries

  • by Eugene Yan
  • Specifically, Using relative imports
  • Example from sklearn’s base.py from .utils.validation import check_X_y from .utils.validation import check_array
  • “Relative imports ensure we search the current package (and import from it) before searching the rest of the PYTHONPATH. “
  • For relative imports, we have to use the from .something import thing form.
  • We cannot use import .something since later on in the code .something isn’t valid.
  • There’s a good discussion of relative imports in pep 328

Michael #2: Skyplane Cloud Transfers

  • Skyplane is a tool for blazingly fast bulk data transfers in the cloud.
  • Skyplane manages parallelism, data partitioning, and network paths to optimize data transfers, and can also spin up VM instances to increase transfer throughput.
  • You can use Skyplane to transfer data:
    • Between buckets within a cloud provider
    • Between object stores across multiple cloud providers
    • (experimental) Between local storage and cloud object stores
  • Skyplane takes several steps to ensure the correctness of transfers: Checksums, verify files exist and match sizes.
  • Data transfers in Skyplane are encrypted end-to-end.
  • Security: Encrypted while in transit and over TLS + config options

Brian #3: 7 things I've learned building a modern TUI framework

  • by Will McGugan
  • Specifically, DictViews are amazing. They have set operations.
  • Example of using items() to get views, then ^ for symmetric difference (done at the C level):

        # Get widgets which are new or changed
        print(render_map.items() ^ new_render_map.items())
    
  • Lots of other great topics in the article

    • lru_cache is fast
    • Unicode art in addition to text in doc strings
    • The fractions module
    • and a cool embedded video demo of some of the new css stuff in Textual
  • Python’s object allocator ascii art

Michael #4: ‘Unstoppable’ Python

  • Python popularity still soaring: ‘Unstoppable’ Python once again ranked No. 1 in the August updates of both the Tiobe and Pypl indexes of programming language popularity.
  • Python first took the top spot in the index last October, becoming the only language besides Java and C to hold the No. 1 position.
  • “Python seems to be unstoppable,” said the Tiobe commentary accompanying the August index.
  • In the alternative Pypl Popularity of Programming Language index, which assesses language popularity based on Google searches of programming language tutorials, Python is way out front.

Extras

Brian:

  • Matplotlib stylesheets can make your chart look awesome with one line of code.

Michael:

Joke: Rakes and AWS


Want to go deeper? Check our projects