Python tutorials

Python 3.13 Preview: Free Threading and a JIT Compiler

Although the final release of Python 3.13 is scheduled for October 2024, you can download and install a preview version today to explore the new features. Notably, the introduction of free threading and a just-in-time (JIT) compiler are among the most exciting enhancements, both designed to give your code a significant performance boost. Check out what’s new in the Python changelog for a complete list of the upcoming features and improvements. This document contains a quick summary of the release […]

Read more

Let’s build and optimize a Rust extension for Python

If your Python code isn’t fast enough, you have many options for compiled languages to write a faster extension. In this article we’ll focus on Rust, which benefits from: Modern tooling, including a package repository called crates.io, and built-in build tool (cargo). Excellent Python integration and tooling. The Rust package (they’re known as “crates”) for Python support is PyO3. For packaging you can use setuptools-rust, for integration with existing setuptools projects, or for standalone extensions you can use Maturin. Memory- […]

Read more

Customizing VS Code Through Color Themes

A well-designed coding environment not only enhances your focus and productivity but also makes coding sessions more enjoyable. In this Code Conversation, your instructor Philipp Acsany will guide you step-by-step through the process of finding, installing, and adjusting color themes in VS Code. You’ll explore the various options available in VS Code and learn how to make fine adjustments to create a setup that suits your personal preferences. In this video course, you’ll: Learn about Themes in VS Code Find […]

Read more

It’s time to stop using Python 3.8

Upgrading to new software versions is work, and work that doesn’t benefit your software’s users. Users care about features and bug fixes, not how up-to-date you are. So it’s perhaps not surprising how many people still use Python 3.8. As of September 2024, about 14% of packages downloaded from PyPI were for Python 3.8. This includes automated downloads as part of CI runs, so it doesn’t mean 3.8 is used in 14% of applications, but that’s still 250 million packages […]

Read more

When should you upgrade to Python 3.13?

Python 3.13 will be out October 1, 2024—but should you switch to it immediately? And if you shouldn’t upgrade just yet, when should you? Immediately after the release, you probably didn’t want to upgrade just yet. But from December 2024 and onwards, upgrading is definitely worth trying, though it may not succeed. To understand why, we need to consider Python packaging, the software development process, and take a look at the history of past releases. The problems with a new […]

Read more

Quiz: Python Virtual Environments: A Primer

Interactive Quiz ⋅ 10 QuestionsBy Kate Finegan Share So you’ve been primed on Python virtual environments! Test your understanding of the tutorial here. The quiz contains 10 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. The maximum score is 100%. Good luck! Start the Quiz » « Browse All Python Quizzes    

Read more

Quiz: Python 3.13: Free-Threading and a JIT Compiler

Interactive Quiz ⋅ 16 QuestionsBy Bartosz Zaczyński Share In this quiz, you’ll test your understanding of the new features in Python 3.13. By working through this quiz, you’ll revisit how to compile a custom Python build, disable the Global Interpreter Lock (GIL), enable the Just-In-Time (JIT) compiler, determine the availability of new features at runtime, assess the performance improvements in Python 3.13, and make a C extension module targeting Python’s new ABI. The quiz contains 16 questions and there is […]

Read more

How to Use Conditional Expressions With NumPy where()

The NumPy where() function is a powerful tool for filtering array elements in lists, tuples, and NumPy arrays. It works by using a conditional predicate, similar to the logic used in the WHERE or HAVING clauses in SQL queries. It’s okay if you’re not familiar with SQL—you don’t need to know it to follow along with this tutorial. You would typically use np.where() when you have an array and need to analyze its elements differently depending on their values. For […]

Read more

When to Use .__repr__() vs .__str__() in Python

One of the most common tasks that a computer program performs is to display data. The program often displays this information to the program’s user. However, a program also needs to show information to the programmer developing and maintaining it. The information a programmer needs about an object differs from how the program should display the same object for the user, and that’s where .__repr__() vs .__str__() comes in. A Python object has several special methods that provide specific behavior. […]

Read more

Python News Roundup: September 2024

As the autumn leaves start to fall, signaling the transition to cooler weather, the Python community has warmed up to a series of noteworthy developments. Last month, a new maintenance release of Python 3.12.5 was introduced, reinforcing the language’s ongoing commitment to stability and security. On a parallel note, Python continues its reign as the top programming language according to IEEE Spectrum’s annual rankings. This sentiment is echoed by the Python Developers Survey 2023 results, which reveal intriguing trends and […]

Read more
1 6 7 8 9 10 182