planetpython.org planetpython.org

Weekly Python StackOverflow Report: (ccxxxv) stackoverflow python report

These are the ten most rated questions at Stack Overflow last week.Between brackets: [question score / answers count]Build date: 2020-07-11 11:58:50 GMTEfficient way to remove half of the duplicate items in a list - [14/7]Why is Numpy with Ryzen Threadripper so much slower than Xeon? - [14/0]Why range(1,1) == range(2,2) is True? - [11/3]What is the most efficient way to fill missing values in this data frame? - [10/6]AWS SAM CLI Fresh...

planetpython.org planetpython.org

Kushal Das: Another try at a new Python module for OpenPGP aka johnnycanencrypt

Using OpenPGP from Python is a pain. There are various documentation/notes on the Internet explaining why, including the famous one from isis agora lovecraft where they explained why they changed the module name to pretty_bad_protocol. sequoia-pgp is a Rust project to do OpenPGP from scratch in Rust, and as library first approach. You can see the status page to see how much work is already done. Using this and Pyo3 project I started...

planetpython.org planetpython.org

Janusworx: A Hundred Days of Code, Day 003 - Methods

Learnt about methods today. Notes follow … My understanding about methods? They are functions in classes that help me manipulate the data the objects contain when they are created. I have been using something them subconsciously all along. The __init__ method, that is called/run automatically every time an object is created. Aha A nice way to unpack the .notation i use Let’s say I have a class SquareNumbers that has a...

planetpython.org planetpython.org

PyCharm: Release: PyCharm 2020.1.3

PyCharm 2020.1.3 is out with some important bug fixes. Update from within PyCharm (Help | Check for Updates), using the JetBrains Toolbox, or by downloading the new version from our website. Highlights: An issue that caused the UI to freeze when processing references in python scratch files was fixed A bug that prevented CoffeeScript to automatically insert imports was fixed  The issue with the keyboard on Ubuntu 20.04, Gnome 3.36...

planetpython.org planetpython.org

pythonwise: Using module __dir__ and __getattr__ for configuration

PEP 562 added support for module level __dir__ and __getitem__. __dir__ is called when the built-in dir function is called on the module__getattr__ is called when an attribute is not found via the regular attribute lookupLet's use this to build an environment based configuration module. Conviruation values has a value, environment key and a function to convert from str to right typeI'm going to use dataclasses and populate values...

planetpython.org planetpython.org

Real Python: Python import: Advanced Techniques and Tips

In Python, you use the import keyword to make code in one module available in another. Imports in Python are important for structuring your code effectively. Using imports properly will make you more productive, allowing you to reuse code while keeping your projects maintainable. This tutorial will provide a thorough overview of Python’s import statement and how it works. The import system is powerful, and you’ll learn how to...

planetpython.org planetpython.org

Spyder IDE: Writing docs is not just writing docs

This blogpost was originally published on the Quansight Labs website. I joined the Spyder team almost two years ago, and I never thought I was going to end up working on docs. Six months ago I started a project with CAM Gerlach and Carlos Cordoba to improve Spyder’s documentation. At first, I didn’t actually understand how important docs are for software, especially for open source projects. However, during all this time I’ve...

planetpython.org planetpython.org

Mike Driscoll: Python 101 – Debugging Your Code with pdb

Mistakes in your code are known as “bugs”. You will make mistakes. You will make many mistakes, and that’s totally fine. Most of the time, they will be simple mistakes such as typos. But since computers are very literal, even typos prevent your code from working as intended. So they need to be fixed. The process of fixing your mistakes in programming is known as debugging. The Python programming language comes with its own...

planetpython.org planetpython.org

The Digital Cat: Flask project setup: TDD, Docker, Postgres and more - Part 3

In this series of posts I explore the development of a Flask project with a setup that is built with efficiency and tidiness in mind, using TDD, Docker and Postgres. Catch-up¶ In the first and second posts I created a Flask project with a tidy setup, using Docker to run the development environment and the tests, and mapping important commands in a management script, so that the configuration can be in a single file and drive the whole...