The Real Python Podcast

How Python Manages Memory and Creating Arrays With np.linspace


Listen Later

Have you wondered how Python manages memory? How are your variables stored in memory, and when do they get deleted? This week on the show, David Amos is here, and he has brought another batch of PyCoder’s Weekly articles and projects.

Along with the Real Python article on Python memory management, we also talk about another article about creating even and non-even spaced arrays in Python with np.linspace.

We share an article titled “The Unholy Way of Using Virtual Environments”. This leads to a discussion on how to structure the directories around a virtual environment.

We also cover several other articles and projects from the Python community including, storing a list in an int, why you should use an ORM (Object Relational Manager), unraveling not in Python, an open-source Python fuzzer, and Python static website generators.

Course Spotlight: How Python Manages Memory

Get ready for a deep dive into the internals of Python to understand how it handles memory management. By the end of this course, you’ll know more about low-level computing, understand how Python abstracts lower-level operations, and find out about Python’s internal memory management algorithms.

Topics:

  • 00:00:00 – Introduction
  • 00:01:38 – np.linspace(): Create Evenly or Non-Evenly Spaced Arrays
  • 00:05:20 – The Unholy Way of Using Virtual Environments
  • 00:17:33 – Storing a list in an int
  • 00:24:48 – Why Should You Use an ORM (Object Relational Mapper)?
  • 00:32:30 – Video Course Spotlight
  • 00:33:24 – Unravelling not in Python
  • 00:40:03 – How Python Manages Memory
  • 00:45:28 – Follow-up from Jupylet
  • 00:46:51 – Announcing the Atheris Python Fuzzer
  • 00:50:42 – nikola: Static Website and Blog Generator
  • Show Links:

    np.linspace(): Create Evenly or Non-Evenly Spaced Arrays – In this tutorial, you’ll learn how to use NumPy’s np.linspace() effectively to create an evenly or non-evenly spaced range of numbers. You’ll explore several practical examples of the function’s many uses in numerical applications.

    The Unholy Way of Using Virtual Environments – If you’ve used virtual environments before, you may have created a venv/ folder inside the root directory of your project. This is standard, but has some downsides. Have you every thought about reversing this and putting your project inside your venv/ folder?

    Storing a list in an int – For a fun exercise, learn how you can leverage Python’s unlimited integer precision to encode and store lists of any size as a single integer. Because, why not?

    Why Should You Use an ORM (Object Relational Mapper)? – Budding web developers learning Model-View-Controller frameworks are taught that they should use an Object Relational Mapper (ORM) to interface with their databases. But the “why” is often brushed aside or omitted entirely, leaving a fledgling programmer with burning questions like “What are ORMs, anyway?” and “What problems do they solve?”

    Unravelling not in Python – In the next blog post in his series about Python’s syntactic sugar, Brett Cannon tackles what would seem to be a very simple bit of syntax, but which actually requires diving into multiple layers to fully implement: not.

    How Python Manages Memory – Get ready for a deep dive into the internals of Python to understand how it handles memory management. By the end of this course, you’ll know more about low-level computing, understand how Python abstracts lower-level operations, and find out about Python’s internal memory management algorithms.

    Announcing the Atheris Python Fuzzer – Get started with fuzzing, a technique for automatically finding bugs in Python code by repeatedly trying various inputs to your program, using Google’s newly open-sourced Python fuzzer called Atheris.

    Project Links:

    • Jupylet: Getting Started
    • nikola: Static Website and Blog Generator
    • atheris: Python Fuzzing Framework
    • Additional Links:

      • Look Ma, No For-Loops: Array Programming With NumPy: Real Python article
      • NumPy: numpy.ndarray
      • An Effective Python Environment: Making Yourself at Home: Real Python article
      • A quick-and-dirty guide on how to install packages for Python: Brett Cannon’s blog
      • Data Management With Python, SQLite, and SQLAlchemy: Real Python article
      • SQLAlchemy: The Python SQL Toolkit and Object Relational Mapper
      • Writing your first Django app: DjangoProject.com
      • Memory Management in Python: Real Python article
      • The Python Language Reference
      • Memory Management: Python docs
      • Pelican: Static Site Generator, Written in Python
      • Lektor: Flexible and Powerful Static Content Management System
      • Level up your Python skills with our expert-led courses:

        • Working With Python Virtual Environments
        • How Python Manages Memory
        • Using NumPy's np.arange() Effectively
        • Support the podcast & join our community of Pythonistas

          ...more
          View all episodesView all episodes
          Download on the App Store

          The Real Python PodcastBy Real Python

          • 4.7
          • 4.7
          • 4.7
          • 4.7
          • 4.7

          4.7

          136 ratings


          More shows like The Real Python Podcast

          View all
          Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

          Software Engineering Radio - the podcast for professional software developers

          272 Listeners

          The Changelog: Software Development, Open Source by Changelog Media

          The Changelog: Software Development, Open Source

          283 Listeners

          Thoughtworks Technology Podcast by Thoughtworks

          Thoughtworks Technology Podcast

          41 Listeners

          Talk Python To Me by Michael Kennedy

          Talk Python To Me

          592 Listeners

          Software Engineering Daily by Software Engineering Daily

          Software Engineering Daily

          624 Listeners

          Soft Skills Engineering by Jamison Dance and Dave Smith

          Soft Skills Engineering

          269 Listeners

          Super Data Science: ML & AI Podcast with Jon Krohn by Jon Krohn

          Super Data Science: ML & AI Podcast with Jon Krohn

          298 Listeners

          Python Bytes by Michael Kennedy and Brian Okken

          Python Bytes

          213 Listeners

          Data Engineering Podcast by Tobias Macey

          Data Engineering Podcast

          142 Listeners

          Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

          Syntax - Tasty Web Development Treats

          982 Listeners

          DataFramed by DataCamp

          DataFramed

          266 Listeners

          Kubernetes Podcast from Google by Abdel Sghiouar, Kaslin Fields

          Kubernetes Podcast from Google

          181 Listeners

          Practical AI by Practical AI LLC

          Practical AI

          190 Listeners

          The Stack Overflow Podcast by The Stack Overflow Podcast

          The Stack Overflow Podcast

          64 Listeners

          The Pragmatic Engineer by Gergely Orosz

          The Pragmatic Engineer

          52 Listeners