Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#20691 closed Cleanup/optimization (fixed)

Documentation for "Choosing between __str__() and __unicode__()" is written for Python2 specifically

Reported by: Jim Garrison Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: timograham@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

At https://docs.djangoproject.com/en/dev/ref/unicode/#choosing-between-str-and-unicode it should be mentioned that __str__() is to be used instead of __unicode__() in Python3. And a note about Python2 compatibility for using __str__() should be provided.

Attachments (2)

20691.diff (690 bytes ) - added by Tim Graham 11 years ago.
20691.2.diff (743 bytes ) - added by Tim Graham 11 years ago.

Download all attachments as: .zip

Change History (9)

by Tim Graham, 11 years ago

Attachment: 20691.diff added

comment:1 by Tim Graham, 11 years ago

Cc: timograham@… added
Has patch: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization
Version: 1.5master

comment:2 by Claude Paroz, 11 years ago

Patch needs improvement: set

I think I would have written a note at the start of the subsection: If you are on Python 3, you can skip this section because you'll always create __str__().... This can prevent a Python 3 user to read the paragraph just to finally realize that he's not concerned.

by Tim Graham, 11 years ago

Attachment: 20691.2.diff added

comment:3 by Tim Graham, 11 years ago

Patch needs improvement: unset

comment:4 by Claude Paroz, 11 years ago

Triage Stage: AcceptedReady for checkin

LVGTM :-)

comment:5 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 8a679386c3924026f8558f9cd0164890a9461e2c:

Fixed #20691 -- Added a note for str() vs. unicode() and Python 3.

Thanks garrison for the suggestion.

comment:6 by Tim Graham <timograham@…>, 11 years ago

In b36f55c5a5bc7e3dac8a811973c7f7ad1c92d7c5:

[1.6.x] Fixed #20691 -- Added a note for str() vs. unicode() and Python 3.

Thanks garrison for the suggestion.

Backport of 8a679386c3 from master.

comment:7 by Tim Graham <timograham@…>, 11 years ago

In 4453d8651af4579b3b83d873cadbda0707b7ab2a:

[1.5.x] Fixed #20691 -- Added a note for str() vs. unicode() and Python 3.

Thanks garrison for the suggestion.

Backport of 8a679386c3 from master.

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