Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-18 Thread Stephen J. Turnbull
Nathaniel Smith writes: > It's also nice to be able to parse some HTML data, make a few changes > in memory, and then serialize it back to HTML. Having this crash on > random documents is rather irritating, esp. if these documents are > standards-compliant HTML as in this case. This example d

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-18 Thread Random832
On Thu, Jan 18, 2018, at 11:04, Stephen J. Turnbull wrote: > Nathaniel Smith writes: > > > It's also nice to be able to parse some HTML data, make a few changes > > in memory, and then serialize it back to HTML. Having this crash on > > random documents is rather irritating, esp. if these docum

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-18 Thread Stephen J. Turnbull
Soni L. writes: > ISO-8859-1 explicitly defines control characters in the \x80-\x9F range, > IIRC. You recall incorrectly. You're probably thinking of RFC 1345. But I've never seen that cited except in the IANA registry. All of ISO 2022, ISO 4873, ISO 8859, and Unicode suggest the ISO 6429

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-18 Thread Soni L.
On 2018-01-18 04:12 PM, Stephen J. Turnbull wrote: Soni L. writes: > ISO-8859-1 explicitly defines control characters in the \x80-\x9F range, > IIRC. You recall incorrectly. You're probably thinking of RFC 1345. But I've never seen that cited except in the IANA registry. All of ISO 202

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-18 Thread Steven D'Aprano
On Wed, Jan 10, 2018 at 07:13:39PM +, Rob Speer wrote: [...] > Having a pip installable library as the _only_ way to use these encodings > is the status quo that I am very familiar with. It's awkward. To use a > package that registers new codecs, you have to import something from that > packag

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-18 Thread Guido van Rossum
Can someone explain to me why this is such a controversial issue? It seems reasonable to me to add new encodings to the stdlib that do the roundtripping requested in the first message of the thread. As long as they have new names that seems to fall under "practicality beats purity". (Modifying exi

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2018-01-18 Thread Nikolas Vanderhoof
> > I sometimes wish that Python included a richer set of assertions rather > than just a single `assert` keyword. Something like Eiffel's concept of > pre-conditions, post-conditions and invariants, where each can be > enabled or disabled independently. Has something like this been proposed for

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2018-01-18 Thread Guido van Rossum
On Thu, Jan 18, 2018 at 7:51 PM, Nikolas Vanderhoof < [email protected]> wrote: > I sometimes wish that Python included a richer set of assertions rather >> than just a single `assert` keyword. Something like Eiffel's concept of >> pre-conditions, post-conditions and invariants, where e

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-18 Thread Nathaniel Smith
On Thu, Jan 18, 2018 at 7:51 PM, Guido van Rossum wrote: > Can someone explain to me why this is such a controversial issue? I guess practicality versus purity is always controversial :-) > It seems reasonable to me to add new encodings to the stdlib that do the > roundtripping requested in the

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2018-01-18 Thread Nikolas Vanderhoof
Thank you for your explanation! ᐧ On Thu, Jan 18, 2018 at 11:00 PM, Guido van Rossum wrote: > On Thu, Jan 18, 2018 at 7:51 PM, Nikolas Vanderhoof < > [email protected]> wrote: > >> I sometimes wish that Python included a richer set of assertions rather >>> than just a single `assert`

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2018-01-18 Thread Steven D'Aprano
On Thu, Jan 18, 2018 at 08:00:01PM -0800, Guido van Rossum wrote: > On Thu, Jan 18, 2018 at 7:51 PM, Nikolas Vanderhoof < > [email protected]> wrote: > > > I sometimes wish that Python included a richer set of assertions rather > >> than just a single `assert` keyword. Something like Ei

[Python-ideas] I

2018-01-18 Thread Lorena Mesa
-- __ *Lorena Mesa* Co-Organizer, PyLadies Chicago Director, Python Software Foundation www.lorenamesa.com @lrenanicole Pronouns: she/her/hers Say wh