Opened 11 years ago

Closed 11 years ago

#21951 closed Cleanup/optimization (fixed)

Docs should assume Python 3 first for __str__/__unicode__ methods

Reported by: Tim Graham Owned by: alasdair
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

def __unicode__ should be replaced with def __str__ and # On Python 3: def __str__(self): should be replaced with # On Python 2: def __unicode__(self):

Change History (5)

comment:1 by alasdair, 11 years ago

Owner: changed from nobody to alasdair
Status: newassigned

comment:2 by alasdair, 11 years ago

I have done most of this ticket in a branch

https://github.com/alasdairnicol/django/compare/ticket_21951

I'm unsure what to do about the following docs pages

comment:3 by Tim Graham, 11 years ago

  1. You could repeat the method twice: first the Python 3 version, then the Python 2 version.
  2. I agree.

comment:4 by alasdair, 11 years ago

  1. You could repeat the method twice: first the Python 3 version, then the Python 2 version.

Thanks for the suggestion. I've updated my patch to include examples for Python 3 and 2.

Pull request https://github.com/django/django/pull/2258

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

Resolution: fixed
Status: assignedclosed

In 8aa1efff6d6cb1589a1977f3e68f4c26eb6adc74:

Fixed #21951 -- Updated docs to use str for Python 3

Thanks Tim Graham for the report and recommendations

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