Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#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 Baptiste Mispelon, 12 years ago

Cc: bmispelon@… added
Keywords: python3 added
Triage Stage: UnreviewedAccepted

There's a lot of places in the documentation with code examples that don't work in python3 (see #19841 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.

Version 0, edited 12 years ago by Baptiste Mispelon (next)

comment:2 by Claude Paroz, 12 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:3 by Baptiste Mispelon, 12 years ago

For what it's worth, I'm +1 on claudep's proposal.

comment:4 by Tim Graham, 11 years ago

Easy pickings: set
Summary: Documentation fix of allow_lazy usage exampleUpdate allow_lazy usage example for Python 3

comment:6 by Tim Graham, 11 years ago

Triage Stage: AcceptedReady for checkin

Left minor comments on the PR, should be good to go without another review though, thanks!

comment:7 by Claude Paroz <claude@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 7442eb1a242ecf9d186d4e7de1b94e360e04782d:

Fixed #20224 -- Update docs examples which mention unicode

Thanks Marc Tamlyn and Tim Graham for the review.

comment:8 by Claude Paroz <claude@…>, 11 years ago

In a9dd6221af2148410c8a26dcbafd1ff8cc0fb107:

[1.6.x] Fixed #20224 -- Update docs examples which mention unicode

Thanks Marc Tamlyn and Tim Graham for the review.
Backport of 7442eb1a24 from master.

Note: See TracTickets for help on using tickets.
Back to Top