Top "Python-2.x" questions

For questions about Python programming that are specific to version 2.x of the language.

Why does python add an 'L' on the end of the result of large exponents?

If you've noticed, python adds an L on to the end of large exponent results like this: >>> 25 ** 25 88817841970012523233890533447265625…

python python-2.x exponent
Is super() broken in Python-2.x?

It's often stated that super should be avoided in Python 2. I've found in my use of super in Python 2 that …

python python-3.x multiple-inheritance super python-2.x
Using print() (the function version) in Python2.x

I understand the difference between a statement and an expression, and I understand that Python3 turned print() into a function. …

python printing python-2.x function-call
Convert unicode with utf-8 string as content to str

I'm using pyquery to parse a page: dom = PyQuery('http://zh.wikipedia.org/w/index.php', {'title': 'CSS', 'printable': 'yes', …

python utf-8 python-2.x mojibake pyquery
Why does Python's dict.keys() return a list and not a set?

I would've expected Python's keys method to return a set instead of a list. Since it most closely resembles the …

python python-2.x
End of support for python 2.7?

Is there a known date/timeframe when python 2.7 will not be supported any more in favor of python 3?

python python-3.x python-2.7 python-2.x
What does `<>` mean in Python?

I'm trying to use in Python 3.3 an old library (dating from 2003!). When I import it, Python throws me an error …

python syntax operators python-2.x
SQLite, python, unicode, and non-utf data

I started by trying to store strings in sqlite using python, and got the message: sqlite3.ProgrammingError: You must not …

python sqlite unicode utf-8 python-2.x
A good way to make long strings wrap to newline?

In my project, I have a bunch of strings that are read in from a file. Most of them, when …

python string python-3.x python-2.x
f-strings giving SyntaxError?

I am getting an error message with my Atom reader here, where it is suggesting the first print.(f"message") …

python syntax-error python-2.x f-string