Tag

f-strings

0 views collected around this technical thread.

IT Services Circle
IT Services Circle
Apr 19, 2025 · Fundamentals

7 Common Pitfalls in Python Function Writing and How to Avoid Them

This article explains the most frequent mistakes developers make when defining Python functions—such as mutable default arguments, inconsistent return types, overly large functions, outdated string formatting, missing type hints, manual index tracking, and misuse of try‑except for flow control—and provides clear, best‑practice solutions with code examples to write cleaner, more maintainable, and efficient Python code.

FunctionsPythonbest practices
0 likes · 8 min read
7 Common Pitfalls in Python Function Writing and How to Avoid Them
Code Mala Tang
Code Mala Tang
Jan 31, 2025 · Fundamentals

Master Python String Formatting: From % Operator to f-Strings

This article explores Python's string formatting techniques—from the classic % operator and the flexible .format() method to modern f-strings—detailing their syntax, advantages, disadvantages, and additional tools like format_map, Template, and zfill, helping developers choose the most readable and efficient approach.

PythonString Formattingf-strings
0 likes · 7 min read
Master Python String Formatting: From % Operator to f-Strings
Python Programming Learning Circle
Python Programming Learning Circle
Nov 16, 2023 · Fundamentals

Key New Features and Improvements in Python 3.12

Python 3.12 introduces enhanced error messages, expanded f‑string capabilities, inline collection optimizations, new buffer protocol support, refined type‑annotation syntax, additional language tweaks, and performance‑focused garbage‑collector changes, providing developers with clearer diagnostics and more expressive, efficient code constructs.

3.12PythonType Annotations
0 likes · 10 min read
Key New Features and Improvements in Python 3.12
Python Programming Learning Circle
Python Programming Learning Circle
Nov 4, 2023 · Fundamentals

Modern Python Standard Library: pathlib, secrets, zoneinfo, dataclasses, logging, f‑strings, tomllib, and setuptools

This article reviews recent Python standard‑library enhancements, showing how pathlib replaces os.path, secrets supersedes os.urandom, zoneinfo replaces pytz, dataclasses improve on namedtuple, proper logging outperforms print, f‑strings beat format, tomllib replaces tomli, and setuptools supersedes distutils, with code examples for each.

dataclassesf-stringslogging
0 likes · 13 min read
Modern Python Standard Library: pathlib, secrets, zoneinfo, dataclasses, logging, f‑strings, tomllib, and setuptools
Python Programming Learning Circle
Python Programming Learning Circle
Oct 21, 2023 · Fundamentals

Highlights of Python 3.12: Improved Error Messages, Expanded f‑string Capabilities, and Type Annotation Enhancements

Python 3.12 introduces enhanced error messages for NameError, SyntaxError, and ImportError, expands f‑string capabilities with unrestricted expressions and deeper nesting, adds inline collection optimizations, and brings numerous type‑annotation improvements such as TypedDict unpacking, the override decorator, and new parameter‑type syntax.

3.12PEPPython
0 likes · 12 min read
Highlights of Python 3.12: Improved Error Messages, Expanded f‑string Capabilities, and Type Annotation Enhancements
Python Programming Learning Circle
Python Programming Learning Circle
Oct 4, 2023 · Fundamentals

Highlights of Python 3.12 Release: Flexible f‑strings, New Debugging API, Subinterpreter GIL, and Type‑Annotation Enhancements

Python 3.12.0 introduces flexible f‑string parsing, support for the buffer protocol, new debugging/profiling APIs, independent subinterpreter GILs, performance optimisations, improved error messages, and expanded type‑annotation syntax, offering developers a more powerful and maintainable language runtime.

3.12PEPPython
0 likes · 7 min read
Highlights of Python 3.12 Release: Flexible f‑strings, New Debugging API, Subinterpreter GIL, and Type‑Annotation Enhancements
Python Programming Learning Circle
Python Programming Learning Circle
Jul 22, 2023 · Fundamentals

Modern Python Standard Library: Pathlib, Secrets, Zoneinfo, Dataclasses, Logging, f‑strings, Tomllib and Setuptools

This article reviews the most useful additions to the Python standard library—Pathlib, Secrets, Zoneinfo, Dataclasses, proper logging, f‑strings, Tomllib and Setuptools—explaining why they replace older modules, showing concise code examples, and offering guidance on adopting them in everyday projects.

PythonSecretsSetuptools
0 likes · 14 min read
Modern Python Standard Library: Pathlib, Secrets, Zoneinfo, Dataclasses, Logging, f‑strings, Tomllib and Setuptools
Laravel Tech Community
Laravel Tech Community
May 23, 2023 · Fundamentals

Python 3.12 Beta 1 Released: New Type Annotation Syntax, Enhanced F‑Strings, Performance Boosts, and Major Deprecations

The first beta of Python 3.12 has been released, introducing new generic class type‑annotation syntax, more flexible f‑string parsing, improved error messages, performance enhancements, Linux profiler support, several new PEPs for typing, and the removal of deprecated features such as distutils, with the final release slated for October 2 2024.

BetaPythonType Annotations
0 likes · 2 min read
Python 3.12 Beta 1 Released: New Type Annotation Syntax, Enhanced F‑Strings, Performance Boosts, and Major Deprecations
Python Programming Learning Circle
Python Programming Learning Circle
Feb 21, 2023 · Fundamentals

New Python Standard Library Features: pathlib, secrets, zoneinfo, dataclasses, logging, f‑strings, tomllib, and setuptools

This article introduces the most useful additions and modern replacements in recent Python releases—including pathlib, the secrets module, zoneinfo, dataclasses, proper logging, f‑strings, the built‑in tomllib, and the transition from distutils to setuptools—showing why and how to adopt them in everyday code.

Pythondataclassesf-strings
0 likes · 15 min read
New Python Standard Library Features: pathlib, secrets, zoneinfo, dataclasses, logging, f‑strings, tomllib, and setuptools