-
Recent Posts
- Workaround for flask/babel/sphinx bug on Python 3+
- enum in Python
- Python Decorators
- Unicode – the basics
- Python’s magic methods
- Gotcha — Mutable default arguments
- Unicode for dummies — Encoding
- How to post source code on WordPress
- Python3 pickling
- Yet Another Lambda Tutorial
- Read-Ahead and Python Generators
- In Java, what is the difference between an abstract class and an interface?
- Newline conversion in Python 3
- Why import star is a bad idea
- Learning Subversion: the mystery of .svn
- How to fix a programmable Northgate keyboard
- Northgate keyboard repair
- An alternative to string interpolation
- A Globals Module pattern
- An Arguments Container pattern
- A Globals Class pattern for Python
- How to open a web browser from Python
- Command-line syntax: some basic concepts
- Unicode for dummies – just use UTF-8
- Unicode Beginners Introduction for Dummies Made Simple
- Multiple constructors in a Python class
- How do I reverse a string in Python 3?
- What’s wrong with use cases?
- Python Packages
- Diagram arrangements
- Python & Java: A Side-by-Side Comparison
- Static vs. dynamic typing of programming languages
- Debugging in Python
- Introduction to Python Decorators
- Gotcha — forgetting parentheses
- Gotcha — backslashes in Windows filenames
- Gotcha — backslashes are escape characters
- Python Gotchas
Categories
- Decorators (2)
- Java and Python (3)
- Keyboards (2)
- Miscellaneous (2)
- Moving to Python 3 (3)
- Python & JSD (1)
- Python debugger (1)
- Python features (9)
- Python Globals (3)
- Python gotchas (5)
- Software Development (2)
- Subversion (1)
- Unicode (4)
Category Archives: Python gotchas
Gotcha — Mutable default arguments
Goto start of series Note: examples are coded in Python 2.x, but the basic point of the post applies to all versions of Python. There’s a Python gotcha that bites everybody as they learn Python. In fact, I think it … Continue reading
Posted in Python gotchas
6 Comments
Gotcha — forgetting parentheses
Goto start of series In Python, omitting the trailing parentheses from the end of a method call (one that takes no arguments) is not a syntax error. The place where this most frequently bites me is with the “close” method … Continue reading
Gotcha — backslashes in Windows filenames
Goto start of series Once upon a time there was a beautiful Windows programmer named Red Ridinghood. One day, Red’s supervisor told her that they were going to start building a new application called GrandmasHouse. The feature list for the … Continue reading
Gotcha — backslashes are escape characters
Goto start of series This is a language feature that is so common on Unix that Unix programmers never think twice about it. Certainly, a Unix programmer would never consider it to be a gotcha. But for someone coming from … Continue reading
Python Gotchas
What is a “gotcha”?The word “gotcha” started out as the expression “Got you!” This is something that someone who speaks idiomatic American English might say when he succeeds in playing a trick or prank on someone else. “I really got … Continue reading