Here's a small fact about Python π
The
It was introduced in Python 3.8 and allows you to assign a value to a variable and use it directly within the expression at the same time.
For example:
Without it, you would have to retrieve the value separately using
Have you ever used the
#Python #Programming #WalrusOperator #Coding #TechFacts #Python3
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
The
:= operator is called the "walrus" because the symbols resemble the eyes and tusks of a walrus π¦It was introduced in Python 3.8 and allows you to assign a value to a variable and use it directly within the expression at the same time.
For example:
while (line := input("Say something: ")) != "quit":
print(f"You said: {line}")Without it, you would have to retrieve the value separately using
input(), and then check it.Have you ever used the
:= operator in your code?#Python #Programming #WalrusOperator #Coding #TechFacts #Python3
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Telegram
AI PYTHON π
Youβve been invited to add the folder βAI PYTHON πβ, which includes 15 chats.
β€4π1
Do not violate the Single Responsibility Principle π―
A function should do one thing, and do it well.
This function does too much:
The problem here is that the calculation of the subtotal, discount, and tax are all combined into one function. Any change to one of these steps can affect the entire calculation.
It's better to break down the logic into smaller, more specialized functions:
This is much better. β
Smaller functions with a single task are easier to test with unit tests because they have fewer dependencies and require less mocking.
Furthermore, isolated components are easier to reuse in different parts of the application or pipeline without bringing in unnecessary dependencies.
Therefore, keep your functions simple and focused.
One function β one responsibility. π
#Python #Coding #SoftwareDevelopment #CleanCode #Programming #BestPractices
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
A function should do one thing, and do it well.
This function does too much:
def calculate_final_total(
price: float,
quantity: int,
discount_rate: float,
tax_rate: float
) -> float:
# Calculate the subtotal
subtotal = price * quantity
# Apply the discount
discounted_amount = subtotal * (1 - discount_rate)
# Calculate the tax
final_total = discounted_amount * (1 + tax_rate)
return final_total
The problem here is that the calculation of the subtotal, discount, and tax are all combined into one function. Any change to one of these steps can affect the entire calculation.
It's better to break down the logic into smaller, more specialized functions:
def calculate_subtotal(price: float, quantity: int) -> float:
return price * quantity
def apply_discount(subtotal: float, discount: float) -> float:
return subtotal * (1 - discount)
def calculate_tax(amount: float, tax_rate: float) -> float:
return amount * (1 + tax_rate)
This is much better. β
Smaller functions with a single task are easier to test with unit tests because they have fewer dependencies and require less mocking.
Furthermore, isolated components are easier to reuse in different parts of the application or pipeline without bringing in unnecessary dependencies.
Therefore, keep your functions simple and focused.
One function β one responsibility. π
#Python #Coding #SoftwareDevelopment #CleanCode #Programming #BestPractices
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Telegram
AI PYTHON π
Youβve been invited to add the folder βAI PYTHON πβ, which includes 15 chats.
β€6
The tell() function in Python π
The tell() function returns the current position of the file pointer within the data stream. It is most often used when working with files. π
The function does not accept any arguments and returns an integer β the position in bytes from the beginning of the stream. π’
#Python #Programming #Coding #FileHandling #DevTips #Tech
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
The tell() function returns the current position of the file pointer within the data stream. It is most often used when working with files. π
The function does not accept any arguments and returns an integer β the position in bytes from the beginning of the stream. π’
with open("file.txt", "rb") as f:
print(f.tell())#Python #Programming #Coding #FileHandling #DevTips #Tech
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€3
π Marking Deprecated Code in Python: deprecated()
In large projects, old functions are not always immediately removed. They are often left for compatibility, but it's important to warn developers that they should no longer be used.
Previously,
In Python 3.13, a
Now, the information about deprecation is part of the API itself. It can be recognized not only during runtime, but also by editors and static analysis tools.
This also works for classes:
This is convenient for libraries, SDKs, and large projects where the API is gradually changing.
#Python #Python313 #Deprecated #Coding #Programming #SoftwareDevelopment
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
In large projects, old functions are not always immediately removed. They are often left for compatibility, but it's important to warn developers that they should no longer be used.
Previously,
warnings.warn()was often used for this purpose:
import warnings
def old_api():
warnings.warn(
"Use new_api()",
DeprecationWarning
)
In Python 3.13, a
deprecated()decorator has been introduced:
from warnings import deprecated
@deprecated("Use new_api()")
def old_api():
return "old"
Now, the information about deprecation is part of the API itself. It can be recognized not only during runtime, but also by editors and static analysis tools.
This also works for classes:
@deprecated("Use NewClient")
class OldClient:
passThis is convenient for libraries, SDKs, and large projects where the API is gradually changing.
#Python #Python313 #Deprecated #Coding #Programming #SoftwareDevelopment
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Telegram
AI PYTHON π
Youβve been invited to add the folder βAI PYTHON πβ, which includes 15 chats.
β€2
π©βπ» heapq.merge(): Combining sorted data!
If you have multiple sources of data that are already sorted, you don't need to collect them into a single collection and sort them again.
In this guide:
β’ We will combine multiple sorted sequences;
β’ We will explore lazy processing of large data sources;
β’ We will configure comparison using the
β’ We will combine data sorted in reverse order.
This is especially useful when working with logs, files, and query results, where each source already provides data in the correct order.
#Python #heapq #DataProcessing #CodingTips #Programming #Algorithms
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
If you have multiple sources of data that are already sorted, you don't need to collect them into a single collection and sort them again.
heapq.merge() combines such sources into a single, ordered iterator.In this guide:
β’ We will combine multiple sorted sequences;
β’ We will explore lazy processing of large data sources;
β’ We will configure comparison using the
key argument;β’ We will combine data sorted in reverse order.
This is especially useful when working with logs, files, and query results, where each source already provides data in the correct order.
#Python #heapq #DataProcessing #CodingTips #Programming #Algorithms
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Telegram
AI PYTHON π
Youβve been invited to add the folder βAI PYTHON πβ, which includes 15 chats.
β€1
Using
π
Normally, we only see the result of serialization:
The standard library includes
The output shows the creation of a dictionary, strings, a list, and the operations used to assemble the final object.
This is useful when debugging your own classes: you can check which global objects and reconstruction mechanisms are included in the serialization.
For further analysis, there's
β οΈ
π₯
#Python #Pickle #DataScience #Debugging #Coding #DevTools
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
pickletools.dis() to analyze serialized data.π
pickle doesn't just store a snapshot of an object; it stores a sequence of instructions for its subsequent reconstruction.Normally, we only see the result of serialization:
import pickle
payload = pickle.dumps(
{"name": "Alex", "roles": ["admin", "user"]}
)
print(len(payload))
The standard library includes
pickletools.dis(), which disassembles the pickle stream and shows its instructions in a readable format.import pickletools
pickletools.dis(payload)
The output shows the creation of a dictionary, strings, a list, and the operations used to assemble the final object.
EMPTY_DICT
SHORT_BINUNICODE 'name'
SHORT_BINUNICODE 'Alex'
SHORT_BINUNICODE 'roles'
EMPTY_LIST
This is useful when debugging your own classes: you can check which global objects and reconstruction mechanisms are included in the serialization.
class User:
def init(self, name):
self.name = name
payload = pickle.dumps(User("Alex"))
pickletools.dis(payload)
For further analysis, there's
pickletools.optimize(): it removes some unused operations from the pickle stream without changing the object being reconstructed.optimized = pickletools.optimize(payload)
assert pickle.loads(optimized).name == "Alex"
β οΈ
pickletools is designed for analyzing pickle streams, not for safely reading untrusted data. You should still not pass unknown pickle data to pickle.loads().π₯
pickletools.dis() allows you to peek inside the serialization and see the instructions from which pickle reconstructs the object.#Python #Pickle #DataScience #Debugging #Coding #DevTools
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€4
Forwarded from Udemy Free
Python For Beginners Course In-Depth
Python: A Comprehensive Introduction to Fundamental Python Concepts and the Python Advanced Programming Concepts
π· Category: IT & Software
π Language: English
π₯ Students: 277,268 students
βοΈ Rating: 4.0/5.0
π° Price:$39.99 βΉ FREE
π Coupon:
π Tap "Get Coupon" below β the code unlocks inside the app after a short rewarded ad.
π By: https://t.me/Udemy26
#Python #DataScience #Automation #FreeCourse #Udemy #OnlineLearning
Python: A Comprehensive Introduction to Fundamental Python Concepts and the Python Advanced Programming Concepts
π· Category: IT & Software
π Language: English
π₯ Students: 277,268 students
βοΈ Rating: 4.0/5.0
π° Price:
π Coupon:
β’β’β’β’β’β’β’β’β’β’ (tap below to reveal)π Tap "Get Coupon" below β the code unlocks inside the app after a short rewarded ad.
π By: https://t.me/Udemy26
#Python #DataScience #Automation #FreeCourse #Udemy #OnlineLearning
β€1
Forwarded from Udemy Free
Hands On Python Data Science - Data Science Bootcamp
Master Python for Data Science with Real-World Applications: Dive Deep into Data Analysis, Machine Learning
π· Category: Development
π Language: English
π₯ Students: 31,524 students
βοΈ Rating: 4.3/5.0
π° Price:$14.99 βΉ FREE
π Coupon:
π Tap "Get Coupon" below β the code unlocks inside the app after a short rewarded ad.
π By: https://t.me/Udemy26
#Programming #Coding #Development #Tech #Python #DataScience
Master Python for Data Science with Real-World Applications: Dive Deep into Data Analysis, Machine Learning
π· Category: Development
π Language: English
π₯ Students: 31,524 students
βοΈ Rating: 4.3/5.0
π° Price:
π Coupon:
β’β’β’β’β’β’β’β’β’β’ (tap below to reveal)π Tap "Get Coupon" below β the code unlocks inside the app after a short rewarded ad.
π By: https://t.me/Udemy26
#Programming #Coding #Development #Tech #Python #DataScience
β€1
π± 270 tools for Python developers
The repository contains:
π«‘ Linters and formatters;
π«‘ Type checkers;
π«‘ Testing tools;
π«‘ Debugging and profiling tools;
π«‘ Package managers;
π«‘ Logging tools;
π«‘ Security tools;
π«‘ Documentation and package building tools.
Save this to your favorites, as the list is updated regularly.
βοΈ Link to the repository
#Python #DevTools #Programming #Coding #SoftwareDevelopment #GitHub
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
The repository contains:
π«‘ Linters and formatters;
π«‘ Type checkers;
π«‘ Testing tools;
π«‘ Debugging and profiling tools;
π«‘ Package managers;
π«‘ Logging tools;
π«‘ Security tools;
π«‘ Documentation and package building tools.
Save this to your favorites, as the list is updated regularly.
βοΈ Link to the repository
#Python #DevTools #Programming #Coding #SoftwareDevelopment #GitHub
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Python Lists: A Quick Reference π
* Definition: Lists are ordered, mutable collections that can contain various data types and duplicates.
* Creating Lists: Creating empty, numerical, mixed, nested lists, and lists with duplicates.
* Accessing List Elements: Accessing elements using positive and negative indexing, as well as slicing with
.
* Common Operations: Adding, inserting, concatenating, deleting, clearing, searching, sorting, and reversing lists.
* List Methods:
,
,
,
,
,
,
,
,
, and
.
* List Comprehension: Quickly creating lists using expressions and conditions.
* List vs. Tuple: Differences between mutable lists and immutable tuples.
* Important Points: Specifics of indexing, slicing, data types, and working with lists.
#Python #Coding #Programming #DataStructures #PythonTips #LearnPython
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
* Definition: Lists are ordered, mutable collections that can contain various data types and duplicates.
* Creating Lists: Creating empty, numerical, mixed, nested lists, and lists with duplicates.
* Accessing List Elements: Accessing elements using positive and negative indexing, as well as slicing with
start:end:step
.
* Common Operations: Adding, inserting, concatenating, deleting, clearing, searching, sorting, and reversing lists.
* List Methods:
append()
,
insert()
,
extend()
,
remove()
,
pop()
,
clear()
,
index()
,
count()
,
sort()
, and
reverse()
.
* List Comprehension: Quickly creating lists using expressions and conditions.
* List vs. Tuple: Differences between mutable lists and immutable tuples.
* Important Points: Specifics of indexing, slicing, data types, and working with lists.
#Python #Coding #Programming #DataStructures #PythonTips #LearnPython
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
Telegram
AI PYTHON π
Youβve been invited to add the folder βAI PYTHON πβ, which includes 15 chats.
β€2
Forwarded from Machine Learning with Python
π Download 10 Python books for FREE:
1. Think Python β OβReilly
https://t.co/X7y3pX68IW
2. The Big Book of Small Python Projects
https://inventwithpython.com/bigbookpython/
3. Data Structures
https://opendatastructures.org/ods-python.pdf
4. Data Science Handbook
https://t.co/9aOLdiAbim
5. Data Analysis
https://wesmckinney.com/book/
6. Data Science
https://t.co/TusyBWGfrx
7. Machine Learning
https://t.co/7veOwESe8q
8. Statistics
https://t.co/waWDQylQpY
9. Think Bayes
https://allendowney.github.io/ThinkBayes2/
10. Clean Code in Python β Packt
https://t.co/OHhVgF1L65
#Python #FreeBooks #Programming #DataScience #MachineLearning #Coding
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
1. Think Python β OβReilly
https://t.co/X7y3pX68IW
2. The Big Book of Small Python Projects
https://inventwithpython.com/bigbookpython/
3. Data Structures
https://opendatastructures.org/ods-python.pdf
4. Data Science Handbook
https://t.co/9aOLdiAbim
5. Data Analysis
https://wesmckinney.com/book/
6. Data Science
https://t.co/TusyBWGfrx
7. Machine Learning
https://t.co/7veOwESe8q
8. Statistics
https://t.co/waWDQylQpY
9. Think Bayes
https://allendowney.github.io/ThinkBayes2/
10. Clean Code in Python β Packt
https://t.co/OHhVgF1L65
#Python #FreeBooks #Programming #DataScience #MachineLearning #Coding
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€6π₯1
π° 15-Hour "Python for Data Science" Course
β‘οΈ Learn Python for Data Science
https://enghusseinsheikho.substack.com/p/15-hour-python-for-data-science-course?r=3hwnr8&utm_campaign=post&utm_medium=web&showWelcomeOnShare=true
#Python #DataScience #Coding #Tech #Learning #FreeCourse
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β‘οΈ Learn Python for Data Science
https://enghusseinsheikho.substack.com/p/15-hour-python-for-data-science-course?r=3hwnr8&utm_campaign=post&utm_medium=web&showWelcomeOnShare=true
#Python #DataScience #Coding #Tech #Learning #FreeCourse
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€2π2π2
π₯ Free IT & Dev Study Kits β 2026 Prep, No Signup
If youβre prepping for cloud, dev, or AI roles this year, these free kits cover the gaps most people skip β cert basics, hands-on labs, and mock exams. No signup traps, no hidden fees.
π Cert E-Book β covers Cisco & AWS fundamentals, good for first-time cert takers
β https://bit.ly/4yrk1Ti
πͺ Online Free Course β structured path, works as a refresher before exams
β https://bit.ly/4hUprRP
βοΈ Free AI Materials β LLM basics to fine-tuning practice notebooks
β https://bit.ly/4yt1iXy
π Cloud Study Guide β cheat-sheet style, handy for interview prep
β https://bit.ly/4el4Eod
π§ Free Mock Exam β test yourself before booking the real thing
β https://bit.ly/4sbWlkl
π Save this or forward it to your dev/study group β good resources are worth sharing. πͺ
π Community: https://chat.whatsapp.com/CS7VOvQCLZG5BJPazBGm1v
π² Personalized help: https://wa.link/xd2fu6
#Python #Cloud #AWS #Cisco #AI #MachineLearning #DevOps #ITCertification #FreeResources #TechCareers
If youβre prepping for cloud, dev, or AI roles this year, these free kits cover the gaps most people skip β cert basics, hands-on labs, and mock exams. No signup traps, no hidden fees.
π Cert E-Book β covers Cisco & AWS fundamentals, good for first-time cert takers
β https://bit.ly/4yrk1Ti
πͺ Online Free Course β structured path, works as a refresher before exams
β https://bit.ly/4hUprRP
βοΈ Free AI Materials β LLM basics to fine-tuning practice notebooks
β https://bit.ly/4yt1iXy
π Cloud Study Guide β cheat-sheet style, handy for interview prep
β https://bit.ly/4el4Eod
π§ Free Mock Exam β test yourself before booking the real thing
β https://bit.ly/4sbWlkl
π Save this or forward it to your dev/study group β good resources are worth sharing. πͺ
π Community: https://chat.whatsapp.com/CS7VOvQCLZG5BJPazBGm1v
π² Personalized help: https://wa.link/xd2fu6
#Python #Cloud #AWS #Cisco #AI #MachineLearning #DevOps #ITCertification #FreeResources #TechCareers
β€5
image.jpg
1.7 MB
Python is the #1 language in AI. π
But you donβt need to learn all of it. (save this) π
#Python #AI #Programming #DataScience #MachineLearning #Tech
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
But you donβt need to learn all of it. (save this) π
#Python #AI #Programming #DataScience #MachineLearning #Tech
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€5
In Python 3.15, a single asterisk replaces nested loops. πβ¨
Previously, to flatten a list, you would write:
Now, you can simply use:
A double asterisk merges dictionaries: π¦
When keys overlap, the last value wins β this is convenient for combining settings from multiple sources. βοΈ
Unpacking removes one level of nesting. In Python 3.14, this syntax within comprehensions will raise a
https://peps.python.org/pep-0798/
#Python #Python315 #Programming #CodingTips #TechNews #Developer
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Previously, to flatten a list, you would write:
rows = [[1, 2], [3], [4, 5]]
flat = [x for row in rows for x in row]
Now, you can simply use:
flat = [*row for row in rows]
# [1, 2, 3, 4, 5]
A double asterisk merges dictionaries: π¦
configs = [
{"debug": False, "timeout": 10},
{"timeout": 30},
]
config = {**part for part in configs}
# {'debug': False, 'timeout': 30}
When keys overlap, the last value wins β this is convenient for combining settings from multiple sources. βοΈ
Unpacking removes one level of nesting. In Python 3.14, this syntax within comprehensions will raise a
SyntaxError. π«https://peps.python.org/pep-0798/
#Python #Python315 #Programming #CodingTips #TechNews #Developer
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Python Enhancement Proposals (PEPs)
PEP 798 β Unpacking in Comprehensions | peps.python.org
This PEP proposes extending list, set, and dictionary comprehensions, as well as generator expressions, to allow unpacking notation (* and **) at the start of the expression, providing a concise way of combining an arbitrary number of iterables into one...
β€7
Forwarded from Machine Learning with Python
π 500+ Cheat Sheets on Machine Learning
This repository contains materials on virtually everything: from basic algorithms and mathematics to neural networks, transformers, and advanced Deep Learning.
Each cheat sheet includes theory, formulas, Python examples, and tips on how to apply them.
β You can find it here
https://github.com/gurovic/MLCheatSheets
#MachineLearning #DeepLearning #Python #DataScience #NeuralNetworks #AI
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
This repository contains materials on virtually everything: from basic algorithms and mathematics to neural networks, transformers, and advanced Deep Learning.
Each cheat sheet includes theory, formulas, Python examples, and tips on how to apply them.
β You can find it here
https://github.com/gurovic/MLCheatSheets
#MachineLearning #DeepLearning #Python #DataScience #NeuralNetworks #AI
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€1
π Django 6.1: Loading related data on demand, cascading deletion handled by the database, and a new email configuration.
The release was made on August 5th. Three major changes:
1. New Field Loading Modes π
In this example, Django executes two queries: one for the books and one for their authors.
The
2. Deletion at the Database Level π
For
Note:
3. Multiple Email Backends π§
The
Before upgrading, check your database versions: you need PostgreSQL 15+, MySQL 8.4+, MariaDB 10.11+, or SQLite 3.37+.
π https://www.djangoproject.com/weblog/2026/aug/05/django-61-released/
#Django #Python #WebDevelopment #Django61 #Backend #TechNews
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
The release was made on August 5th. Three major changes:
1. New Field Loading Modes π
FETCH_PEERS retrieves data for related objects from the same QuerySet when accessing an un-loaded field. This helps combat the N+1 problem:from django.db import models
books = Book.objects.fetch_mode(models.FETCH_PEERS)
for book in books:
print(book.author.name)
In this example, Django executes two queries: one for the books and one for their authors.
The
FETCH_RAISE mode raises an exception instead of performing an implicit query β useful for detecting unexpected database accesses.2. Deletion at the Database Level π
For
ForeignKey.on_delete, the options DB_CASCADE, DB_SET_NULL, and DB_SET_DEFAULT are now available. The logic is handled directly by the database using SQL ON DELETE.Note:
DB_CASCADE does not trigger pre_delete and post_delete signals.3. Multiple Email Backends π§
The
MAILERS configuration allows you to define different connections using a dictionary, and you can select the desired connection when sending emails using the using parameter.Before upgrading, check your database versions: you need PostgreSQL 15+, MySQL 8.4+, MariaDB 10.11+, or SQLite 3.37+.
π https://www.djangoproject.com/weblog/2026/aug/05/django-61-released/
#Django #Python #WebDevelopment #Django61 #Backend #TechNews
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Django Project
Django 6.1 released
Posted by Jacob Walls on Aug. 5, 2026
β€2
π Cheat sheet for Python:
Higher-order functions:
πΉ
πΉ
πΉ
These functions help to process collections concisely and perform data transformations.
#Python #Programming #Coding #HigherOrderFunctions #DataProcessing #TechTips
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Higher-order functions:
πΉ
map() - applies a function to each elementπΉ
filter() - selects elements based on a conditionπΉ
reduce() - sequentially combines elements into a single valueThese functions help to process collections concisely and perform data transformations.
#Python #Programming #Coding #HigherOrderFunctions #DataProcessing #TechTips
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€4
π asyncio.Queue.shutdown() β shutting down handlers without special markers
Starting with Python 3.13, the asyncio.Queue can be closed using shutdown(), without the need to use None or other special values.
After shutdown(), no new items are added, and existing items are processed. When the queue is empty, get() will raise asyncio.QueueShutDown.
For a forced shutdown, there is shutdown(immediate=True), which clears the queue but may disrupt the normal behavior of join().
#Python #Asyncio #Programming #DevTips #Coding #Tech
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Starting with Python 3.13, the asyncio.Queue can be closed using shutdown(), without the need to use None or other special values.
import asyncio
async def worker(queue):
while True:
try:
task = await queue.get()
except asyncio.QueueShutDown:
break
print(task)
queue.task_done()
async def main():
queue = asyncio.Queue()
task = asyncio.create_task(worker(queue))
await queue.put("task-1")
await queue.put("task-2")
queue.shutdown()
await queue.join()
await task
asyncio.run(main())
After shutdown(), no new items are added, and existing items are processed. When the queue is empty, get() will raise asyncio.QueueShutDown.
For a forced shutdown, there is shutdown(immediate=True), which clears the queue but may disrupt the normal behavior of join().
#Python #Asyncio #Programming #DevTips #Coding #Tech
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€1
Extracting named entities (NER) from contract texts using spaCy. π
Manually parsing legal documents to find organizations, dates, and amounts is too time-consuming. The spaCy library allows you to automatically find and classify named entities in unstructured text. We will write a Python script that loads a language model and recognizes key entities in a contract excerpt. π
We will install the spaCy library and download a pre-trained language model for working with the Russian language. π·πΊ
The spaCy library and the Russian language model have been successfully loaded into the environment. β
We will create a Python script called
#spacy #python #nlp #dataScience #programming #automation
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Manually parsing legal documents to find organizations, dates, and amounts is too time-consuming. The spaCy library allows you to automatically find and classify named entities in unstructured text. We will write a Python script that loads a language model and recognizes key entities in a contract excerpt. π
We will install the spaCy library and download a pre-trained language model for working with the Russian language. π·πΊ
pip install spacy && python3 -m spacy download ru_core_news_sm
The spaCy library and the Russian language model have been successfully loaded into the environment. β
We will create a Python script called
extract_ner.py that processes the contract text through a language pipeline and prints the identified entities. πimport spacy
nlp = spacy.load("ru_core_news_sm")
text = "OOO 'Vector' undertakes to pay 500,000 rubles by October 15, 2026, in Moscow."
doc = nlp(text)
for ent in doc.ents:
print(f"{ent.text}
#spacy #python #nlp #dataScience #programming #automation
β¨ Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Telegram
AI PYTHON π
Youβve been invited to add the folder βAI PYTHON πβ, which includes 15 chats.
β€1