#32709: Examples in django.utils.baseconv.BaseConverter's docstring are
incorrect.
----------------------------+--------------------------------------
Reporter: pythonwood | Owner: pythonwood
Type: Bug | Status: assigned
Component: Utilities | Version: 3.2
Severity: Normal | Resolution:
Keywords: utils | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
----------------------------+--------------------------------------
Changes (by pythonwood):
* has_patch: 0 => 1
Old description:
> I have a simple pull in gihub # 14339
> [https://github.com/django/django/pull/14339/commits/86e0ec9df0b5ed7a9160c10974bf1adef19eb539]
>
> {{{
> def encode(self, i):
> neg, value = self.convert(i, self.decimal_digits, self.digits, '-')
> }}}
>
> try and know that arg '-' should be self.sign:
>
> {{{
> In [1]: from django.utils import baseconv
>
> In [2]: base11 = baseconv.BaseConverter('0123456789-', sign='$')
>
> In [3]: base11.encode('$1234')
>
> ValueError: substring not found
> }}}
New description:
----
NOW:
In fact, I found the right way is patch doc string instead of code.
I have a simple right (new) pull in gihub 14344
[https://github.com/django/django/pull/14344]
----
BEFORE:
I have a simple pull in gihub # 14339
[https://github.com/django/django/pull/14339/commits/86e0ec9df0b5ed7a9160c10974bf1adef19eb539]
{{{
def encode(self, i):
neg, value = self.convert(i, self.decimal_digits, self.digits, '-')
}}}
try and know that arg '-' should be self.sign:
{{{
In [1]: from django.utils import baseconv
In [2]: base11 = baseconv.BaseConverter('0123456789-', sign='$')
In [3]: base11.encode('$1234')
ValueError: substring not found
}}}
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32709#comment:5>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.d6b4dfce7ceb9d98f8965ef82724af22%40djangoproject.com.