Profiling Performance in Python

Do you want to optimize the performance of your Python program to make it run faster or consume less memory? Before diving into any performance tuning, you should strongly consider using a technique called software profiling. It can help you decide whether optimizing the code is necessary and, if so, which parts of the code you should focus on. Sometimes, the return on investment in performance optimizations just isn’t worth the effort. If you only run your code once or […]

Read more

Crescent library brings privacy to digital identity systems

Digital identities, the electronic credentials embedded in phone wallets, workplace logins, and other apps, are becoming ubiquitous. While they offer unprecedented convenience, they also create new privacy risks, particularly around tracking and surveillance.  One of these risks is linkability, the ability to associate one or more uses of a credential to a specific person. Currently, when people use their mobile driver’s license or log into various apps,  

Read more

Quiz: How to Write Docstrings in Python

Interactive Quiz ⋅ 7 QuestionsBy Philipp Acsany Share Want to get comfortable writing and using Python docstrings? This quiz helps you revisit best practices, standard conventions, and common tools. You’ll review the basics of docstring syntax, how to read them at runtime, and different formatting styles. For more details, check out the tutorial How to Write Docstrings in Python. The quiz contains 7 questions and there is no time limit. You’ll get 1 point for each correct answer. At the […]

Read more

How to Write Docstrings in Python

Writing clear, consistent docstrings in Python helps others understand your code’s purpose, parameters, and outputs. In this guide on how to write docstrings in Python, you’ll learn about best practices, standard formats, and common pitfalls to avoid, ensuring your documentation is accessible to users and tools alike. By the end of this tutorial, you’ll understand that: Docstrings are strings used to document your Python code and can be accessed at runtime. Python comments and docstrings have important differences. One-line and […]

Read more

Applicability vs. job displacement: further notes on our recent research on AI and occupations

Recently, we released a paper (Working with AI: Measuring the Occupational Implications of Generative AI) that studied what occupations might find AI chatbots useful, and to what degree. The paper sparked significant discussion, which is no surprise since people care deeply about the future of AI and jobs–that’s part of why we think it’s important  

Read more

Coauthor roundtable: Reflecting on healthcare economics, biomedical research, and medical education

[THEME MUSIC FADES]  The book passage I read at the top is from the epilogue, and I think it’s a truly fitting closing sentiment for the conclusion of this podcast series—because it calls back to the very beginning. As I’ve mentioned before, Carey, Zak, and I wrote The AI Revolution in Medicine as a guide to help answer these big questions, particularly as they pertain to medicine. You know, we wrote the book to empower people to make a choice […]

Read more

Python’s with Statement: Manage External Resources Safely

Watch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Context Managers and Using Python’s with Statement Python’s with statement allows you to manage external resources safely by using objects that support the context manager protocol. These objects automatically handle the setup and cleanup phases of common operations. By using the with statement alongside appropriate context managers, you can focus on your core logic […]

Read more

Working With Python’s .__dict__ Attribute

Python’s .__dict__ is a special attribute in classes and instances that acts as a namespace, mapping attribute names to their corresponding values. You can use .__dict__ to inspect, modify, add, or delete attributes dynamically, which makes it a versatile tool for metaprogramming and debugging. In this video course, you’ll learn about using .__dict__ in various contexts, including classes, instances, and functions. You’ll also explore its role in inheritance with practical examples and comparisons to other tools for manipulating attributes. By […]

Read more
1 2 3 4 934