Python Bytes   /     #28 The meaning of _ in Python

Description

Brian #1: pep8.org : PEP 8 — the Style Guide for Python Code"This stylized presentation of the well-established PEP 8 was created by Kenneth Reitz (for humans)."From PEP 8: "This document gives coding conventions for the Python code comprising the standard library in the main Python distribution."PEP8 is not only used for the standard library. Many if not most open source Python packages adhere to at least most of the PEP8 recommendationstesting plugins can help you make sure your code meets the guidelines (for good or bad).The pep8.org presentation is easy to read, with a left side clickable table of contents.Nice color coded examples. Green for good, Red for bad.links to specific items make it easy to share with others something specific.Good advice, but don't be a pep8-bully.Michael #2: Tokio: Asyncio event loop written in Rust languageAsyncio event loop written in Rust languageIt is still in alpha stage. It provides most of asyncio event loop apis, except udp. TCP api is more or less stableAiohttp tests pass with tokio loop (~1800 tests)Mostly interesting as an example of Rust + PythonProject is still in early stage of developmentBrian #3: Python BoilerplateInteractive online tool for creating script and small project boilerplate code.Just starting, with "how to help" link.Select Python 2 or 3executable script or notargparselogging.gitignoreFlaskunittest or pytesttoxfills in main.py, plus other files like test_sample.py, requirements.txt, tox.ini, etc.Michael #4: Instagram switching to Python 3 on one branchAncient Django but still productiveRan out of 32-bit user IDs before they ran out of Django power. Added sharing support to Django OremTurned off GC for perfUpgraded entirely to 3.6 in a few monthsWhy? Type hintsScaling server perfasyncioPython 3 is where the future community work is happening Strategies No user impactStill shippingTesting process was interestingThis is a concrete roadmap for every large companyBrian #5: The Meaning of Underscores in Python single and double underscore meaningsdunder is "double underscore" Single Leading Underscore: _varmethod or variable for internal useconvention onlydoesn't apply to collection.namedtupleSingle Trailing Underscore: var_used to avoid name collision with keywords Double Leading Underscore: __varinternal use by a single class level.Python will name mangle this so that subclasses don't have to avoid parent class double leading underscore names Double Leading and Trailing Underscore: __var__no name manglingspecial names. dunder methods__call__ and __init__, etc. Single Underscore: _in code : temp variable, don't care variablewon't get a warning if you don't reference it againin REPL: last valueMichael #6: The future is looking bright for PythonStack Overflow recently released a cool new tool called Trends (previously covered)Check out the Most Popular Languages trend chartPython has, by a very large margin, the greatest positive slope (future?)And Py3 vs Py2

Subtitle
Duration
00:20:59
Publishing date
2017-06-02 08:00
Link
https://pythonbytes.fm/episodes/show/28/the-meaning-of-in-python
Contributors
  Michael Kennedy
author  
Enclosures
https://pythonbytes.fm/episodes/download/28/the-meaning-of-in-python.mp3
audio/mpeg