[issue24416] Have date.isocalendar() return a structseq instance

2020-12-15 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: (Apologies if this isn't the right place and/or time for this kind of negative feedback. I'm open to suggestions for a more appropriate venue) I found it disheartening that my work on this ticket has been erased. While I understand that other

[issue38975] Add direct anchors to regex syntax documentation

2019-12-09 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: I've tried using subsection (level 3) for each syntax element and I'm not sure it's a big improvement. Pros: * Visible ΒΆ anchors which make it easier to copy/paste a reference link Cons: * headings have a slightly different style (bigger font

[issue38975] Add direct anchors to regex syntax documentation

2019-12-04 Thread Baptiste Mispelon
New submission from Baptiste Mispelon : While writing documentation about regexps for a project I help maintain, I wanted to link to some specific aspects of Python's implementation (in my case, non-capturing groups) which are described on https://docs.python.org/3/library/re.html

[issue24416] Return a namedtuple from date.isocalendar()

2016-09-20 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: I updated the patch based on Raymond's feedback. I don't know C at all and I tried to mimic the namedtuple usage of timemodule.c as much as I could (until the code compiled and the test suite passed). I still have two questions: * It seems that the Python

[issue24416] Return a namedtuple from date.isocalendar()

2015-06-14 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: Here's a new patch with the name `IsoCalendarDate` used (it also fixes a wrong version in the `versionadded` section in the docs). Thanks -- Added file: http://bugs.python.org/file39705/issue24416_4.diff

[issue24416] Return a namedtuple from date.isocalendar()

2015-06-09 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: I didn't know about issues with pickling. As for the performance issue, is date.isocalendar() really performance critical? I found a precedent for replacing a tuple by a namedtuple: https://hg.python.org/cpython/rev/ef72142eb8a2 I'm trying my hand

[issue24416] Return a namedtuple from date.isocalendar()

2015-06-09 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: As far as I know, using a namedtuple in place of a tuple is fully backwards-compatible. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24416

[issue24416] Return a namedtuple from date.isocalendar()

2015-06-09 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: Here's a second attempt at a patch which seems to work. I don't know C at all but I used _decimal.c to try and figure out how to use namedtuple in C. The code compiles and the datetime test suite runs. I've added a test for the new feature and a note

[issue24416] Return a namedtuple from date.isocalendar()

2015-06-09 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: For the name, I took (un)inspiration from ParseResult: https://docs.python.org/3/library/urllib.parse.html?highlight=urlparse#urllib.parse.ParseResult Any better suggestion is welcome of course. -- ___ Python

[issue24416] Return a namedtuple from date.isocalendar()

2015-06-09 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: Some C code cleanups suggested by haypo. -- Added file: http://bugs.python.org/file39668/issue24416_3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24416

[issue24416] Return a namedtuple from date.isocalendar()

2015-06-09 Thread Baptiste Mispelon
New submission from Baptiste Mispelon: Currently, `date.isocalendar()` returns a plain tuple of (year, week, weekday). It would be a bit more useful if this tuple could be made into a namedtuple (with fields year, week and weekday). -- components: Library (Lib) messages: 245061 nosy

[issue23511] Broken code example in email module documentation

2015-02-25 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: I wasn't sure if that was going to be out of scope or not. Here's an attached patch that fixes the remaining usages of `open` inside `Doc/includes` to always use a context manager. -- Added file: http://bugs.python.org/file38233

[issue23511] Broken code example in email module documentation

2015-02-24 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: Patch attached. -- keywords: +patch Added file: http://bugs.python.org/file38228/issue23511.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23511

[issue23511] Broken code example in email module documentation

2015-02-24 Thread Baptiste Mispelon
New submission from Baptiste Mispelon: The first code example at https://docs.python.org/3.5/library/email-examples.html throws an `AttributeError` because `MIMEText`'s constructor expects a `str` object, not a `bytes` one: # Import smtplib for the actual sending function ... import smtplib

[issue20997] Wrong URL fragment identifier in search result

2014-03-20 Thread Baptiste Mispelon
New submission from Baptiste Mispelon: When doing a search for PYTHONDONTWRITEBYTECODE on the 2.7 docs (http://docs.python.org/2/search.html?q=PYTHONDONTWRITEBYTECODE), the first (and only) search result is the following link: http://docs.python.org/2/using/cmdline.html?highlight

[issue17802] html.HTMLParser raises UnboundLocalError:

2013-04-20 Thread Baptiste Mispelon
New submission from Baptiste Mispelon: When trying to parse the string `ab`, the parser raises an UnboundLocalError: {{{ from html.parser import HTMLParser p = HTMLParser() p.feed('ab') p.close() Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python3.3

[issue16173] Wrong offset on SyntaxError when identifier contains non-ascii characters

2012-10-09 Thread Baptiste Mispelon
New submission from Baptiste Mispelon: When a syntax error happens, the exception that gets printed has an extra line with a caret that helps locate the error. If the line also contains an identifier with non-ascii characters, then this caret is misaligned (too far on the right). I've