Issue #358

PEP 584 (+/- Operators for Dictionaries), Refactoring Python Apps, and More

March 5, 2019

PEP 584 (+/- Operators for Dictionaries), Refactoring Python Apps, and More
#358 – MARCH 5, 2019 VIEW IN BROWSER
The PyCoder’s Weekly Logo
PEP 584: Adding + and - Operators to the Built-In Dict Class
This PEP suggests adding merge + and difference - operators to the built-in dict class. The merge operator will have the same relationship to the dict.update method as the list concatenation operator has to list.extend, with dict difference being defined analogously. I think this is a pretty cool feature suggestion. Related discussion here.
PYTHON.ORG

Refactoring Python Applications for Simplicity
In this step-by-step tutorial, you’ll learn how to refactor your Python application to be simpler and more maintainable and have fewer bugs. You’ll cover code metrics, refactoring tools, and common anti-patterns.
REAL PYTHON

Become a Python Guru With PyCharm
PyCharm is the Python IDE for Professional Developers by JetBrains providing a complete set of tools for productive Python, Web and scientific development. Be more productive and save time while PyCharm takes care of the routine.
JETBRAINSsponsor

Managing Elasticsearch in Django
A small tutorial on how to manage Elasticsearch efficiently in a Django project. It uses elasticsearch-dsl as an ORM and a custom management system similar to django-haystack (which uses outdated ES).
HARSH BHIMJYANI • Shared by Harsh Bhimjyani

pydis: A Redis Clone in Python 3 to Disprove Some Falsehoods About Performance
An experiment to disprove some of the falsehoods about performance and optimisation regarding software and interpreted languages in particular. In short, this is a Redis clone, written in < 250 lines of idiomatic Python code, providing a subset of Redis’ functionality for which there are official benchmarks. Pydis is ~60% as fast as the compiled C version of Redis, as measured in number of operations per second.
GITHUB.COM/BORAMALPER

Python Bytes Episode 119 Recorded at PyCascades in Seattle
Together with Trey Hunner and Eric Chou, I was a guest on Mike and Brian’s excellent Python Bytes podcast. We recorded this episode “live” and together in the same room at the PyCascades conference in Seattle.
PYTHON BYTES podcast

EditorConfig: Maintain Consistent Coding Styles Between Different Editors and IDEs
This is super handy if you’re switching between editors or if you want to make sure your team uses the same indentation settings no matter which editor each developer uses.
EDITORCONFIG.ORG


Discussions


Python Multiprocessing: Understanding Logic Behind chunksize
An amazing, thorough, readable answer on Stack Overflow about the multiprocessing module.
STACK OVERFLOW • Shared by Christian Long

Useful Python Tricks
“What are some cool uses for Python for maybe younger people or just people without office jobs in general?”
REDDIT

from mylibrary import * 😉
TWITTER.COM/REALPYTHON


Python Jobs


Brought to you by Indeed Primesponsor
Apply today to see what job opportunities are waiting for you!

Sr Enterprise Python Developer
KOGNITIV 📍 TORONTO, CANADA

Senior Systems Engineer
PRETECKT 📍 HAMILTON, CANADA

Python Web Developer
PREMIERE DIGITAL SERVICES 📍 REMOTE

Software Developer
L2T, LLC 📍 HERNDON, VA

Tech Lead / Senior Software Engineer
INDEED.COM INCUBATOR 📍 SEATTLE, WA

Python Software Engineer
POLE STAR SPACE APPLICATIONS LTD. 📍 LONDON, UK

Senior Engineer Python
DEEP IMPACT AG 📍 WINTERTHUR, SWITZERLAND

Python Software Engineer
WOOGA 📍 BERLIN, GERMANY

Computer Science Teacher
ARTCENTER COLLEGE OF DESIGN 📍 PASADENA, CA

Senior Python Engineer
15FIVE 📍 NEW YORK, NY

Software Engineer
CHARON TECHNOLOGIES 📍 HERNDON, VA

Web UI Developer
CHARON TECHNOLOGIES 📍 HERNDON, VA

More Python Jobs >>>


Articles & Tutorials


Traditional Face Detection With Python
In this article on face detection with Python, you’ll learn about a historically important algorithm for object detection that can be successfully applied to finding the location of a human face within an image.
REAL PYTHON

How to Write a Python Web Framework—Part III
The third post of the series where you’ll be writing our own Python framework just like Flask and Django.
JAHONGIR RAHMONOV

Take ActiveState’s Dev Survey for a Chance to Win a Lego Star Wars TIE Fighter
We want to know your pain points building & programming open source languages. We’ve got 3 cool prizes too. Click to speed through this ~7min survey →
ACTIVESTATEsponsor

Python Quirks: Implicit Return
Python functions always have to return something, right? Well, it’s complicated…
PHILIP TRAUNER

Python in VS Code Adds a New Test Explorer With Auto-Discovery
Pretty cool: This release includes the ability to visualize, navigate and run unit tests through a visual test explorer. Supports unittest, pytest and nose.
DAN TAYLOR

Python Security Best Practices Cheat Sheet
Covers some best practices for securely using Python.
SNYK.IO

Bleach: Stepping Down as Maintainer
Bleach is a Python library for sanitizing and linkifying text from untrusted sources for safe usage in HTML. In this post the author explains why he’s stepping down as a maintainer for the library and gives a retrospective on OSS project maintenance.
WILL KAHN-GREENE

Contributing to Classiness (In Django)
Django’s contribute_to_class() is an undocumented part of the ORM’s internal API that allows you to attach to/hook into a model.
JAMES BENNETT

Understanding Python Slices
“Slices are both common and convenient ways to extract portions of Python data structures — usually with builtin objects, but also on your own. Once you get used to slices, you’ll see lots of uses for them, and wonder how you got along without them.”
REUVEN M. LERNER • Shared by Reuven M. Lerner

Revisiting PEP 394: The “python” Command on Unix-Like Systems
With the uptake of Python 3 (and the imminent end of life for Python 2.7), there is a question of which version of Python a user should get when they type “python” at the command line or have it as part of a shebang (“#!”) line in a script.
JAKE EDGE

My Involvement in the Python/Django Community
Paolo is an open-source contributor to Django. In this article he talks about his involvement in the Python community, how he got started using Python in the first place, and how he ended up contributing to the Django web framework.
PAOLO MELCHIORRE

Hosting Private Pip Packages Using Azure Artifacts
Marry science code with operations? How to organize your Python code as private Pip package with Azure Artifacts and integrate it using modified virtual environments.
ZEROWITHDOT.COM


Projects & Code


subsync: Automagically Synchronize Subtitles With Video
GITHUB.COM/SMACKE

Python-Prolog-Interpreter: Mini-Prolog Interpreter Written in Python 3
GITHUB.COM/PHOTONLINES

Hy: A Lisp Dialect Embedded in Python
HYLANG.ORG

accessify: Python Class Members Accessibility Levels (Private, Protected)
GITHUB.COM/DMYTROSTRILETSKYI

automat: Self-Service Finite-State Machines for the Programmer on the Go
GITHUB.COM/GLYPH

codebraid: Live Code in Pandoc Markdown (Python, Julia, Rust, R)
GITHUB.COM/GPOORE • Shared by Geoffrey Poore

lazynlp: Scrape and Clean Web Pages to Create Massive Monolingual Datasets
GITHUB.COM/CHIPHUYEN

pygram11: Simple and Fast Histogramming in Python via Pybind11 (C++ Interop) and OpenMP
GITHUB.COM/DRDAVIS

pytest-azurepipelines: Formatting PyTest Output for Azure Pipelines UI
PYPI.ORG

📆🐍 Upcoming Python Events


Reunión Python Valencia
March 7, 2019

Canberra Python Meetup
March 7, 2019

Sydney Python User Group (SyPy)
March 7, 2019

Python Miami
March 9 to March 10, 2019

Leipzig Python User Group Meeting
March 12, 2019

TuPLE (Tucson Python Language Enthusiasts)
March 12, 2019
Happy Pythoning!
Copyright © 2019 PyCoder’s Weekly, All rights reserved.