Major update of Jupyter Notebook, highlights include real-time collaboration, interactive debugging, directory, themes and dark mode, internationalization, improved accessibility, compact view on mobile devices.
TL;DR
Jupyter Notebook 7 makes its grand debut, and the Steering Council brings good news on PEP 703—the proposal to make the GIL optional—just as the first downloadable Chinese LLaMA2 model arrives.
Articles & Tutorials
× 15Python's basic types Int, List, Dict, Tuple, Str do not support weak references, while Object, Type, Set and other types do support weak references, why is this the case? The article gives its own analysis.
When should distributed locks be used? How to implement distributed locks with py-redis, what is the process of locking and unlocking? What are the points to note about the lock timeout, how to implement WatchDog to automatically renew the lock?
An introductory tutorial on PyScript, introducing installation, basic knowledge, usage with Flask and advanced features.
What is file I/O, why is it much slower than main memory I/O? What factors does the speed of file I/O depend on? What methods are there to improve file I/O performance?
The article introduces some best programming practices, covering code structure, pre-commit, type hints, docstrings, lint, Pydantic, spell check, testing and other aspects.
The article provides a detailed comparison of the currently most popular 6 logging frameworks: logging, loguru, structlog, Eliot, logbook and picologging. The most recommended are undoubtedly the first two, the others are for interest.
How to use cProfile to perform performance analysis on Python code? The article briefly introduces its usage, and gives two advanced usage methods: context manager and decorator.
The article introduces the advantages of functional programming, Python's support for functional programming, best practices and errors to avoid when writing Python programs.
What limitations does f-string have before Python 3.12? What changes will the upcoming 3.12 version bring? New feature preview: embedded expressions can reuse quotes, f-string allows the use of backslashes, comments can be written in multi-line expressions, arbitrary levels of f-string nesting, optimized f-string error prompts...
Introduces how to use a mixin named AsyncMixin to create asynchronous constructors in Python.
Insecure Direct Object References (IDOR) is a security vulnerability, the article introduces the harm of this vulnerability, how to identify and fix IDOR vulnerabilities.
The author introduces how to identify and optimize CPU-intensive code in feature storage to improve the performance of the core model. What is event loop delay, how to monitor the time consumed by asynchronous code?
Cross-compiling refers to compiling programs for another architecture on one computer. This PEP attempts to reveal the challenges of cross-compiling and improve upon them.
There are many solutions for recording and managing third-party libraries in projects. But how to manage third-party library dependencies for single files? This PEP proposes a very simple specification format.
🎁Python Trend Weekly🎁 has been published for free for 13 issues, visit the link below to view all content: https://pythoncat.top/tags/weekly
Projects & Resources
× 12An AI-based resume matcher that scores resumes based on the keywords in the job description. It uses Qdrant (an efficient vector similarity search tool) to measure the match between the resume and the job description.
PyHAT aims to promote htmx+ASGI+TailwindCSS in Python, this project lists some introductory resources, tutorials, design theories, peripheral ecosystems, etc.
Based on the ChatGLM2-6B pedestal language model, it achieves a Pass@1 pass rate of 35.9% in Python, surpassing the larger StarCoder-15B. CodeGeeX plugin supports VS Code, IntelliJ IDEA, PyCharm, GoLand, WebStorm, Android Studio and other IDEs. (star 1K)
Open source and commercially available Chinese version of the Llama2 model and Chinese-English SFT dataset, compatible with all optimizations for the original llama-2-chat model. (star 1K)
A Chinese open source project, three steps to get started with LLaMA2, the author has written a series of tutorial blogs.
A full-stack project that quickly builds web applications from data and AI.
Allows injecting custom code into a running Python process to achieve dynamic debugging, modifying variable values, cracking encryption, analyzing runtime behavior, etc. Supports various injection methods, including injecting into the Python interpreter, injecting into specific functions, injecting into specific threads, etc. (star 2.7K)
Provides interactive debugging and monitoring functions in running Python processes, using Python's "ptrace" mechanism, by injecting code into the target process, it can be connected via SSH or telnet protocols for remote interaction. Compatible with gevent and eventlet, with some restrictions.
A very comprehensive tutorial project, guiding how to run Python on Docker, set up development environment and container extensions, testing and deployment, etc.
When using frameworks like Selenium and Playwright, you need to manage various browser drivers. This project simplifies the management and usage of browser drivers.
An open-source plotting library by JetBrains, it can create beautiful, interactive statistical charts and data visualizations. It provides a ggplot2-like plotting API for Python and Kotlin developers. (star 1.1K)
A small python-gtk program that edits PDF documents in an intuitive way. Its backend is based on pikepdf, which is a library for reading and writing PDF files. (star 2.3K)
Discussion & Question
× 1In the 11th issue of the newsletter, we shared "If PEP-703 is adopted, Meta will invest manpower to support", now there is progress, the steering committee plans to accept PEP-703! This post lists several basic principles and a three-stage development plan. Backward compatibility is the top priority, this will not be Python 4.
Sponsor & Support
If you find the weekly valuable, feel free to appreciate or buy me coffee to support!
If you like the weekly, please share it with others who need it, so that more people can benefit from it~