#21951 closed Cleanup/optimization (fixed)

Docs should assume Python 3 first for __str__/__unicode__ methods

Reported by: timo Owned by: alasdair
Component: Documentation Version: master
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 Changed 19 months ago by alasdair

  • Owner changed from nobody to alasdair
  • Status changed from new to assigned

comment:2 Changed 19 months ago by alasdair

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 Changed 19 months ago by timo

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

comment:4 Changed 19 months ago by alasdair

  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 Changed 19 months ago by Tim Graham <timograham@…>

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

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