We received a pull request
https://github.com/divio/django-cms/pull/5390, for a documentation example.
The code sample uses a Python-2-style __unicode__() method; in Python 3 it would be __str__().
It’s quite right that this needs to be updated, but we’d like to do it in a more systematic way.
The way we change examples itself needs to be consistent.
Firstly, all new and existing documentation code examples should follow the best-practice way to write Django code, which is:
* make it compatible with Python 3 by default
* use the provided shims and utilities so that the same code will *also* work with Python 2
* in the rare cases where different code is required to support both, both should be provided
This is all described, with examples, in
https://docs.djangoproject.com/en/1.9/topics/python3.
Secondly, it’s not enough just to change existing examples on a case-by-case basis as people happen to find them - we’re going to have to comb through the documentation for examples, update, and test them, and then land them as far as possible en masse.
Comments? Brave volunteers?
Daniele