#20639: Documentation talks about __unicode__() which doesn't exist in Python 3.x anymore -------------------------------------+------------------------------------- Reporter: flabifabi@… | Owner: nobody Type: | Status: closed Cleanup/optimization | Version: 1.5 Component: Documentation | Resolution: invalid Severity: Normal | Triage Stage: Keywords: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Description changed by lukeplant:
Old description: > https://docs.djangoproject.com/en/1.5/intro/tutorial01/ > On the above mentioned page, the tutorial tells me to write a > __unicode__() method to get a human-readable represantation of my object. > I tried but it didn't work. I then found out that since I'm using Python > 3.3 I have to define a method __ string __(). Since there's a block > debating whether to use __str__() or __unicode__() anyways, may it would > be useful to add a hint for Python 3.x users to always use __str__(). > > Regards, > Fabian > > P.S.: Unfortunately the methodnames beginning with two underscores are > interpreted as wiki syntax. New description: https://docs.djangoproject.com/en/1.5/intro/tutorial01/ On the above mentioned page, the tutorial tells me to write a `__unicode__()` method to get a human-readable representation of my object. I tried but it didn't work. I then found out that since I'm using Python 3.3 I have to define a method `__ str __()`. Since there's a block debating whether to use `__str__()` or `__unicode__()` anyways, may it would be useful to add a hint for Python 3.x users to always use `__str__()`. Regards, Fabian -- -- Ticket URL: <https://code.djangoproject.com/ticket/20639#comment:2> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/078.1fb23ca74bd5576f3cc64dc956217c4c%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.