#20224 closed Cleanup/optimization (fixed)
Update allow_lazy usage example for Python 3
| Reported by: | Alexey Boriskin | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Normal | Keywords: | python3 |
| Cc: | bmispelon@… | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
There is a line in the usage example of allow_lazy:
fancy_utility_function = allow_lazy(fancy_utility_function, unicode)
It would be better to use six.text_type instead of unicode, because unicode does not exist of python3
Change History (8)
comment:1 by , 13 years ago
| Cc: | added |
|---|---|
| Keywords: | python3 added |
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 13 years ago
Python 3 support will not be called experimental in 1.6, so yes, a fix is welcome here. However, I'm not sure if always using six is a good idea. It's the right thing to do to support both Python 2 and Python 3, but most users will probably target either one or the other. An alternative could be adding a str/unicode note somewhere in the docs and refer to that note each time we are using unicode in examples.
comment:4 by , 12 years ago
| Easy pickings: | set |
|---|---|
| Summary: | Documentation fix of allow_lazy usage example → Update allow_lazy usage example for Python 3 |
comment:6 by , 12 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Left minor comments on the PR, should be good to go without another review though, thanks!
comment:7 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
There's a lot of places in the documentation with code examples that don't work in python3 (see #19211 for example).
I think we need to decide what to do about it in general.
From what I understand, the current position is that python3 support is "experimental", so the documentation stays python2-oriented. This will surely change at some point, and probably soon.