Code

Opened 15 months ago

Closed 12 months ago

Last modified 12 months ago

#20224 closed Cleanup/optimization (fixed)

Update allow_lazy usage example for Python 3

Reported by: void 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

Attachments (0)

Change History (8)

comment:1 Changed 15 months ago by bmispelon

  • Cc bmispelon@… added
  • Keywords python3 added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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.

Last edited 15 months ago by bmispelon (previous) (diff)

comment:2 Changed 15 months ago by claudep

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 15 months ago by bmispelon

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

comment:4 Changed 12 months ago by timo

  • Easy pickings set
  • Summary changed from Documentation fix of allow_lazy usage example to Update allow_lazy usage example for Python 3

comment:6 Changed 12 months ago by timo

  • Triage Stage changed from Accepted to Ready for checkin

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

comment:7 Changed 12 months ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 7442eb1a242ecf9d186d4e7de1b94e360e04782d:

Fixed #20224 -- Update docs examples which mention unicode

Thanks Marc Tamlyn and Tim Graham for the review.

comment:8 Changed 12 months 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.