Opened 4 years ago

Closed 3 years ago

Last modified 3 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: master
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 Changed 4 years ago by Baptiste Mispelon

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 4 years ago by Baptiste Mispelon (next)

comment:2 Changed 4 years ago by Claude Paroz

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 Changed 4 years ago by Baptiste Mispelon

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

comment:4 Changed 3 years ago by Tim Graham

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

comment:6 Changed 3 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

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

comment:7 Changed 3 years ago by Claude Paroz <claude@…>

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 Changed 3 years ago by Claude Paroz <claude@…>

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