This article originates from the Python usage (Http://stackoverflow.com/questions/101268/hidden-features-of-python) that you would like to introduce Python as very useful and more overlooked. Hopefully I and everyone will write high-quality Python code (see PEP8). This article is a series of articles, the environment for python2.x.
- Argument Unpacking
- Braces
- Chaining Comparison Operators
- Decorators
- Default Argument gotchas/dangers of Mutable default arguments
- Descriptors
- Dictionary Default
.get
value
- DocString Tests
- Ellipsis slicing Syntax
- Enumeration
- For/else
- Function as ITER () argument
- Generator expressions
import this
- In place Value swapping
- List Stepping
__missing__
Items
- Multi-line Regex
- Named string Formatting
- Nested List/generator comprehensions
- New types at runtime
.pth
Files
- ROT13 Encoding
- Regex debugging
- Sending to Generators
- Tab completion in Interactive interpreter
- Ternary Expression
try/except/else
- unpacking+
print()
function
with
Statement
Python-implied features