Today I learned that Python doesn't care about how many spaces you indent as long as it's consistent
Call me stupid for only discovering this after 6 years, but did you know that you can use as many spaces you want to indent, as long as they're consistent within one indented block. For example, the following (awful) code block gives no error:
def say_hi(bye = False):
print("Hi")
if bye:
print("Bye")
/r/Python
https://redd.it/1nkidxq
Call me stupid for only discovering this after 6 years, but did you know that you can use as many spaces you want to indent, as long as they're consistent within one indented block. For example, the following (awful) code block gives no error:
def say_hi(bye = False):
print("Hi")
if bye:
print("Bye")
/r/Python
https://redd.it/1nkidxq
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
enso: A functional programming framework for Python
Hello all, I'm here to make my first post and 'release' of my functional programming framework, enso. Right before I made this post, I made the repository public. You can find it here.
# What my project does
enso is a high-level functional framework that works over top of Python. It expands the existing Python syntax by adding a variety of features. It does so by altering the AST at runtime, expanding the functionality of a handful of built-in classes, and using a modified tokenizer which adds additional tokens for a preprocessing/translation step.
I'll go over a few of the basic features so that people can get a taste of what you can do with it.
1. Automatically curried functions!
How about the function add, which looks like
def add(x:a, y:a) -> a:
return x + y
Unlike normal Python, where you would need to call add with 2 arguments, you can call this
f = add(2)
f(2)
4
2. A map operator
Since functions are automatically curried, this
/r/Python
https://redd.it/1nksvm0
Hello all, I'm here to make my first post and 'release' of my functional programming framework, enso. Right before I made this post, I made the repository public. You can find it here.
# What my project does
enso is a high-level functional framework that works over top of Python. It expands the existing Python syntax by adding a variety of features. It does so by altering the AST at runtime, expanding the functionality of a handful of built-in classes, and using a modified tokenizer which adds additional tokens for a preprocessing/translation step.
I'll go over a few of the basic features so that people can get a taste of what you can do with it.
1. Automatically curried functions!
How about the function add, which looks like
def add(x:a, y:a) -> a:
return x + y
Unlike normal Python, where you would need to call add with 2 arguments, you can call this
add with only one argument, and then call it with the other argument later, like so:f = add(2)
f(2)
4
2. A map operator
Since functions are automatically curried, this
/r/Python
https://redd.it/1nksvm0
GitLab
Evan Semenoff / enso · GitLab
enso is a functional programming framework for Python.
T-Strings: What will you do?
Good evening from my part of the world!
I'm excited with the new functionality we have in Python 3.14. I think the feature that has caught my attention the most is the introduction of t-strings.
I'm curious, what do you think will be a good application for t-strings? I'm planning to use them as better-formatted templates for a custom message pop-up in my homelab, taking information from different sources to format for display. Not reinventing any functionality, but certainly a cleaner and easier implementation for a message dashboard.
Please share your ideas below, I'm curious to see what you have in mind!
/r/Python
https://redd.it/1nkq8pt
Good evening from my part of the world!
I'm excited with the new functionality we have in Python 3.14. I think the feature that has caught my attention the most is the introduction of t-strings.
I'm curious, what do you think will be a good application for t-strings? I'm planning to use them as better-formatted templates for a custom message pop-up in my homelab, taking information from different sources to format for display. Not reinventing any functionality, but certainly a cleaner and easier implementation for a message dashboard.
Please share your ideas below, I'm curious to see what you have in mind!
/r/Python
https://redd.it/1nkq8pt
Python documentation
What’s new in Python 3.14
Editors, Adam Turner and Hugo van Kemenade,. This article explains the new features in Python 3.14, compared to 3.13. Python 3.14 was released on 7 October 2025. For full details, see the changelog...
FYI: PEP 2026 (CalVer) was shot down back in February - no jumping from 3.14.y to 3.25.y or 2025.x.y
PEP2026 discussed replacing the current Semantic Versioning with a Calender Versioning, where some options were 26.x.y (where 26 was from 2026), or 3.26.y (because there's currently a yearly release, they would just shift the minor version about 10 points).
Luckily this idea was shot down, back in Feb, because I was NOT looking forward to having to mess around with versions.
---
I'm mentioning it, because I recall a discussion back in Januari that they were going to do this, and quite a few people disliked the idea, so I'm happy to inform you that it's dead.
---
edit: It was shot down in this post
/r/Python
https://redd.it/1nl0x1p
PEP2026 discussed replacing the current Semantic Versioning with a Calender Versioning, where some options were 26.x.y (where 26 was from 2026), or 3.26.y (because there's currently a yearly release, they would just shift the minor version about 10 points).
Luckily this idea was shot down, back in Feb, because I was NOT looking forward to having to mess around with versions.
---
I'm mentioning it, because I recall a discussion back in Januari that they were going to do this, and quite a few people disliked the idea, so I'm happy to inform you that it's dead.
---
edit: It was shot down in this post
/r/Python
https://redd.it/1nl0x1p
Python Enhancement Proposals (PEPs)
PEP 2026 – Calendar versioning for Python | peps.python.org
This PEP proposes updating the versioning scheme for Python to include the calendar year.
Playing with Django 6
https://youtu.be/doAMlgrTGbE?si=2zJEZL9eecHo4vAP
/r/django
https://redd.it/1nl0wrj
https://youtu.be/doAMlgrTGbE?si=2zJEZL9eecHo4vAP
/r/django
https://redd.it/1nl0wrj
YouTube
Django 6.0 Is Here! CSP Nonces, Background Tasks, Partials & More
The Django 6.0 Alpha release is here, and it brings some big improvements! In this tutorial, I’ll walk you through the key new features step by step, including:
🔹 Content Security Policy (CSP) Nonce Support
- Why inline scripts are dangerous
- How nonces…
🔹 Content Security Policy (CSP) Nonce Support
- Why inline scripts are dangerous
- How nonces…
Herramientas para trabajar en Django de mode API first
Quiero empezar a trabajar con Django y DRF definiendo primero la API (API first). Hago una definición de OpenAPI en un fichero YAML, pero no encuentro buenas herramientas para comprobar que mis vistas de Django cumplen con ese contrato.
/r/django
https://redd.it/1nl49u5
Quiero empezar a trabajar con Django y DRF definiendo primero la API (API first). Hago una definición de OpenAPI en un fichero YAML, pero no encuentro buenas herramientas para comprobar que mis vistas de Django cumplen con ese contrato.
/r/django
https://redd.it/1nl49u5
Reddit
From the django community on Reddit
Explore this post and more from the django community
Best way to document my code ?
Hi, I would like to cleanly document my Python+Flask code ; this is my first time so I'm looking for help.
For now I've been doing it in a javadoc-style (see below), but i don't know if there are tools integrating it (VSCode integration, HTML doc generation, and other intelligent features). For instance I'm seing that python's
In short, what is the standard(s), and what are the tools to exploit ?
Thanks in advance !
\---
Example of what I'm doing currently and want to improve on :
def routeAPIRequest(self, configFromPayload):
"""
@param llmConfig a config dict, such as the output from processPayloadData()
can be None if no config coverride is meant
@return Response (meant to be transmitted in
/r/flask
https://redd.it/1nl4q4l
Hi, I would like to cleanly document my Python+Flask code ; this is my first time so I'm looking for help.
For now I've been doing it in a javadoc-style (see below), but i don't know if there are tools integrating it (VSCode integration, HTML doc generation, and other intelligent features). For instance I'm seing that python's
typing library allows features similar to \\@param and \\@return that are closer to the code, that feels like a better idea than what I'm doing already.In short, what is the standard(s), and what are the tools to exploit ?
Thanks in advance !
\---
Example of what I'm doing currently and want to improve on :
def routeAPIRequest(self, configFromPayload):
"""
@param llmConfig a config dict, such as the output from processPayloadData()
can be None if no config coverride is meant
@return Response (meant to be transmitted in
/r/flask
https://redd.it/1nl4q4l
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
A script to get songs from a playlist with matching total length
#What my project does
Basically, you input:
- A public youtube playlist
- Target duration
You get:
- Song groups with a matching total length
#Target Audience
So I think this is one of the most specific 'problems'..
I've been making a slow return to jogging, and one of the changes to keep things fresh was to jog until the playlist ended. (Rather than meters, or a route)
I am incrementing the length of the playlist by 15 seconds between each run, and each time finding a group of songs with a matching length can be tiring, which is why I thought of this 😅
So I guess this is for people who want a shuffled playlist, with a specific duration, for some reason.
This is 'py-playlist-subset', try it out 👀
https://github.com/Tomi-1997/py-playlist-subset
/r/Python
https://redd.it/1nl4bxv
#What my project does
Basically, you input:
- A public youtube playlist
- Target duration
You get:
- Song groups with a matching total length
#Target Audience
So I think this is one of the most specific 'problems'..
I've been making a slow return to jogging, and one of the changes to keep things fresh was to jog until the playlist ended. (Rather than meters, or a route)
I am incrementing the length of the playlist by 15 seconds between each run, and each time finding a group of songs with a matching length can be tiring, which is why I thought of this 😅
So I guess this is for people who want a shuffled playlist, with a specific duration, for some reason.
This is 'py-playlist-subset', try it out 👀
https://github.com/Tomi-1997/py-playlist-subset
/r/Python
https://redd.it/1nl4bxv
GitHub
GitHub - Tomi-1997/py-playlist-subset: Generate a list of songs with requsted length, from a youtube playlist.
Generate a list of songs with requsted length, from a youtube playlist. - Tomi-1997/py-playlist-subset
Python + Django + HID DigitalPersona 4500: Biometric Registration & MySQL Integration
https://youtu.be/fB23Sdu5n2c
/r/django
https://redd.it/1nl9zlq
https://youtu.be/fB23Sdu5n2c
/r/django
https://redd.it/1nl9zlq
YouTube
Python Django Biometric Registration with HID DigitalPersona 4500 | Save Fingerprints to MySQL DB
In this video, I demonstrate Biometric Registration in a Python Django Application using the HID DigitalPersona 4500 Fingerprint Scanner. You will see How to Capture Person Details, perform Fingerprint Enrollment and then Save both the Personal Data and Biometric…
Doubt regarding a resource
I wanted ask you guys how is this django tutorial???: https://www.youtube.com/playlist?list=PL4cUxeGkcC9iqfAag3a\_BKEX1N43uJutw , this is a tutorial by net ninja
I know people here suggest the official docs over everything else, but i wanna get done with the basics of django and straight away start with building projects
If you guys have any other resource suggestion i am all ears
/r/djangolearning
https://redd.it/1nkw4tp
I wanted ask you guys how is this django tutorial???: https://www.youtube.com/playlist?list=PL4cUxeGkcC9iqfAag3a\_BKEX1N43uJutw , this is a tutorial by net ninja
I know people here suggest the official docs over everything else, but i wanna get done with the basics of django and straight away start with building projects
If you guys have any other resource suggestion i am all ears
/r/djangolearning
https://redd.it/1nkw4tp
YouTube
Complete Django Tutorial
Share your videos with friends, family, and the world
I just released reaktiv v0.19.2 with LinkedSignals! Let me explain what Signals even are
I've been working on this reactive state management library for Python, and I'm excited to share that I just added LinkedSignals in v0.19.2. But first, let me explain what this whole "Signals" thing is about.
# I built Signals = Excel for your Python code
You know that frustrating bug where you update some data but forget to refresh the UI? Or where you change one piece of state and suddenly everything is inconsistent? I got tired of those bugs, so I built something that eliminates them completely.
Signals work just like Excel - change one cell, and all dependent formulas automatically recalculate:
from reaktiv import Signal, Computed, Effect
# Your data (like Excel cells)
name = Signal("Alice")
age = Signal(25)
# Automatic formulas (like Excel =A1&" is "&B1&" years old")
greeting = Computed(lambda: f"{name()} is {age()} years old")
# Auto-display (like Excel charts that update automatically)
display = Effect(lambda: print(greeting()))
# Prints: "Alice is 25 years old"
/r/Python
https://redd.it/1nl9f0h
I've been working on this reactive state management library for Python, and I'm excited to share that I just added LinkedSignals in v0.19.2. But first, let me explain what this whole "Signals" thing is about.
# I built Signals = Excel for your Python code
You know that frustrating bug where you update some data but forget to refresh the UI? Or where you change one piece of state and suddenly everything is inconsistent? I got tired of those bugs, so I built something that eliminates them completely.
Signals work just like Excel - change one cell, and all dependent formulas automatically recalculate:
from reaktiv import Signal, Computed, Effect
# Your data (like Excel cells)
name = Signal("Alice")
age = Signal(25)
# Automatic formulas (like Excel =A1&" is "&B1&" years old")
greeting = Computed(lambda: f"{name()} is {age()} years old")
# Auto-display (like Excel charts that update automatically)
display = Effect(lambda: print(greeting()))
# Prints: "Alice is 25 years old"
/r/Python
https://redd.it/1nl9f0h
Reddit
From the Python community on Reddit: I just released reaktiv v0.19.2 with LinkedSignals! Let me explain what Signals even are
Explore this post and more from the Python community
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
# Weekly Thread: Resource Request and Sharing 📚
Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!
## How it Works:
1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.
## Guidelines:
Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.
## Example Shares:
1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.
## Example Requests:
1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.
Share the knowledge, enrich the community. Happy learning! 🌟
/r/Python
https://redd.it/1nljibj
# Weekly Thread: Resource Request and Sharing 📚
Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!
## How it Works:
1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.
## Guidelines:
Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.
## Example Shares:
1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.
## Example Requests:
1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.
Share the knowledge, enrich the community. Happy learning! 🌟
/r/Python
https://redd.it/1nljibj
Amazon
Fluent Python: Clear, Concise, and Effective Programming
Fluent Python: Clear, Concise, and Effective Programming [Ramalho, Luciano] on Amazon.com. *FREE* shipping on qualifying offers. Fluent Python: Clear, Concise, and Effective Programming
🚀 DRF Auth Kit - Complete DRF Authentication with Type Safety & OpenAPI
After months of development and fixing issues from the initial release, I'm excited to reintroduce DRF Auth Kit - a modern Django REST Framework authentication toolkit that addresses the pain points of existing packages.
What makes it different:
🔥 Full Type Safety - Complete type hints with mypy/pyright support
📋 Perfect OpenAPI Schema - Auto-generated docs that work flawlessly with any client generator
🍪 JWT Cookies - Secure HTTP-only cookies with automatic token management
🔐 Easy MFA Setup - Email & app-based MFA with backup codes, proper OpenAPI schemas included
🌐 Simple Social Auth - Django Allauth integration with minimal setup (like headless mode but easier)
🌍 57 Languages - Built-in i18n support
Why we built this:
Inspired by
- No more broken OpenAPI schemas
- Complete type safety throughout
- Zero manual schema fixes needed
- Easy customization without breaking functionality
Perfect for:
- Teams wanting bulletproof API documentation
- Projects requiring type-safe authentication
- Anyone tired of manually fixing auth schemas
- Developers who value clean, well-documented code
⭐ GitHub: https://github.com/forthecraft/drf-auth-kit
📚 Docs: https://drf-auth-kit.readthedocs.io/
Would love feedback from the community!
/r/django
https://redd.it/1nl9qy9
After months of development and fixing issues from the initial release, I'm excited to reintroduce DRF Auth Kit - a modern Django REST Framework authentication toolkit that addresses the pain points of existing packages.
What makes it different:
🔥 Full Type Safety - Complete type hints with mypy/pyright support
📋 Perfect OpenAPI Schema - Auto-generated docs that work flawlessly with any client generator
🍪 JWT Cookies - Secure HTTP-only cookies with automatic token management
🔐 Easy MFA Setup - Email & app-based MFA with backup codes, proper OpenAPI schemas included
🌐 Simple Social Auth - Django Allauth integration with minimal setup (like headless mode but easier)
🌍 57 Languages - Built-in i18n support
Why we built this:
Inspired by
dj-rest-auth and django-trench, but enhanced to solve their limitations:- No more broken OpenAPI schemas
- Complete type safety throughout
- Zero manual schema fixes needed
- Easy customization without breaking functionality
Perfect for:
- Teams wanting bulletproof API documentation
- Projects requiring type-safe authentication
- Anyone tired of manually fixing auth schemas
- Developers who value clean, well-documented code
pip install drf-auth-kit[all] # Includes MFA + social auth
⭐ GitHub: https://github.com/forthecraft/drf-auth-kit
📚 Docs: https://drf-auth-kit.readthedocs.io/
Would love feedback from the community!
/r/django
https://redd.it/1nl9qy9
GitHub
GitHub - forthecraft/drf-auth-kit: Modern Django REST Framework authentication toolkit with JWT cookies, social login, and 2FA…
Modern Django REST Framework authentication toolkit with JWT cookies, social login, and 2FA support - forthecraft/drf-auth-kit
Why isn't the copy() method part of the Sequence and MutableSequence ABCs?
The
Note that I am not asking how to work with that design choice. Instead I am trying to understand it.
/r/Python
https://redd.it/1nllur9
The
Sequence ABC from collections.abc does not include an abstract method copy(). What are the reasons for that design choice?Note that I am not asking how to work with that design choice. Instead I am trying to understand it.
/r/Python
https://redd.it/1nllur9
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Looking to get hire in the django as a freelancer
i am having a experience of 2+ years as Django, next and react. i am looking for part time, contract or freelancing jobs. worked on more than 4 or 5 project intermediate level. Looking forward to get connected.
/r/django
https://redd.it/1nlgouk
i am having a experience of 2+ years as Django, next and react. i am looking for part time, contract or freelancing jobs. worked on more than 4 or 5 project intermediate level. Looking forward to get connected.
/r/django
https://redd.it/1nlgouk
Reddit
From the django community on Reddit
Explore this post and more from the django community
Scintilla, Qt and alternative text editor widgets
Hello fellow python enjoyers,
I'm currently considering moving away from PyQt6 to go on PySide6 due to license issues. However, it would imply moving away from QScintilla as a text editor too, since there is no bindings for Scintilla on PySide side.
I don't want to go back to "default" QPlainTextEdit since my needs are close to the ones of a Source Code editor (especially indentation guides).
Do any of you know an alternative? I'm leaning towards Monaco via QTMonaco, but there might be better options or easier to adapt (I still need to find out resources regarding Monaco).
/r/Python
https://redd.it/1nltf58
Hello fellow python enjoyers,
I'm currently considering moving away from PyQt6 to go on PySide6 due to license issues. However, it would imply moving away from QScintilla as a text editor too, since there is no bindings for Scintilla on PySide side.
I don't want to go back to "default" QPlainTextEdit since my needs are close to the ones of a Source Code editor (especially indentation guides).
Do any of you know an alternative? I'm leaning towards Monaco via QTMonaco, but there might be better options or easier to adapt (I still need to find out resources regarding Monaco).
/r/Python
https://redd.it/1nltf58
GitHub
GitHub - bec-project/qtmonaco: Monaco editor with pyside6 bindings
Monaco editor with pyside6 bindings. Contribute to bec-project/qtmonaco development by creating an account on GitHub.
Flask + ReactJs + MySQL + Crawler
Is it possible to create a web app for web crawling such as Broken Acces Control vulnerability using said language? I was planning to use
Backend : Flask
Frontend : ReactJS
Database : MySQL
Crawler : Playwright
Also, does that mean using reactjs as frontend will be different as using PHP, HTML and Bootstrap??
/r/flask
https://redd.it/1nlve3z
Is it possible to create a web app for web crawling such as Broken Acces Control vulnerability using said language? I was planning to use
Backend : Flask
Frontend : ReactJS
Database : MySQL
Crawler : Playwright
Also, does that mean using reactjs as frontend will be different as using PHP, HTML and Bootstrap??
/r/flask
https://redd.it/1nlve3z
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Fake OS - Worth making?
So, a while ago i discovered this repo on github: https://github.com/crcollins/pyOS
In summary, its a program trying to simulate an OS by having a kernel, programs (terminal commands), a filesystem etc.
Ive been impressed of the dedication for something that isnt useful in your everyday life. Though ive seen the small group of repositories making similar projects fascinating, and thought about making my own, but ive yet to come up a reason for it.
So here i am, wanting to ask:
Is something like this worth making, following the structure of a real computer, containing a kernel, drivers, the OS layer, BIOS etc?
What would be ways to make it useful / more interesting?
All feedback is appreciated, thanks in advance :O
/r/Python
https://redd.it/1nlwpe8
So, a while ago i discovered this repo on github: https://github.com/crcollins/pyOS
In summary, its a program trying to simulate an OS by having a kernel, programs (terminal commands), a filesystem etc.
Ive been impressed of the dedication for something that isnt useful in your everyday life. Though ive seen the small group of repositories making similar projects fascinating, and thought about making my own, but ive yet to come up a reason for it.
So here i am, wanting to ask:
Is something like this worth making, following the structure of a real computer, containing a kernel, drivers, the OS layer, BIOS etc?
What would be ways to make it useful / more interesting?
All feedback is appreciated, thanks in advance :O
/r/Python
https://redd.it/1nlwpe8
GitHub
GitHub - crcollins/pyOS: A simple pure Python OS.
A simple pure Python OS. Contribute to crcollins/pyOS development by creating an account on GitHub.
Which Django Youtube channel do you recommend?
Hi Django lovers.
I want to learn Django exactly, to do this i can go with Django offical documents but i know a few awesome Django channel that i want to watch all video because there are many things with Django.
Problem is, there are so many videos.
https://www.youtube.com/@CodeWithStein 363 videos 180 hours
https://www.youtube.com/@bugbytes3923 423 videos 128 hours
https://www.youtube.com/@CloudWithDjango 222 videos 68 hours
What do you think, where should i start with?
Thanks
/r/django
https://redd.it/1nluode
Hi Django lovers.
I want to learn Django exactly, to do this i can go with Django offical documents but i know a few awesome Django channel that i want to watch all video because there are many things with Django.
Problem is, there are so many videos.
https://www.youtube.com/@CodeWithStein 363 videos 180 hours
https://www.youtube.com/@bugbytes3923 423 videos 128 hours
https://www.youtube.com/@CloudWithDjango 222 videos 68 hours
What do you think, where should i start with?
Thanks
/r/django
https://redd.it/1nluode
YouTube
Code With Stein
I create tutorial videos to teach you everything you need to know about coding. Django, Python, Vue, Htmx and much much more!
Template for django-ninja?
I've been wanting to try Django ninja for some AI app that I'm trying tk build, because of its async support. However, I could not find an extensive template that shows all the batteries included for Django ninja. Can anybody recommend such template?
/r/django
https://redd.it/1nlwoo4
I've been wanting to try Django ninja for some AI app that I'm trying tk build, because of its async support. However, I could not find an extensive template that shows all the batteries included for Django ninja. Can anybody recommend such template?
/r/django
https://redd.it/1nlwoo4
Reddit
From the django community on Reddit
Explore this post and more from the django community