[Python-Dev] Re: Adding new escapes to regex module

2022-08-18 Thread Antoine Pitrou
On Wed, 17 Aug 2022 19:23:02 +0100
MRAB  wrote:
> >> 
> >> I do not like introducing escapes which are not supported in other RE
> >> implementations. There is a chance of future conflicts.
> >> 
> >> Java broke compatibility in Java 8 by redefining \v from a single
> >> vertical tab character to the vertical whitespace class. I am not sure
> >> that it is a good example that we should follow, because different
> >> semantic of \v in raw and non-raw strings is a potential source of bugs.
> >> But with special flag which controls the meaning of \v it may be more safe.
> >> 
> >> Horizontal whitespace can be matched by [
> >> \t\xA0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000] in re or [\t\p{Zs}]
> >> in regex. Vertical whitespace can be matched by
> >> [\n\x0b\f\r\x85\u2028\u2029]. Note that there is a dedicated Unicode
> >> category for horizontal whitespaces (excluding the tab itself), but not
> >> for vertical whitespaces, it means that vertical whitespaces are less
> >> important.
> >> 
> >> In any case it is simple to introduce special Unicode categories and use
> >> \p{ht} and \p{vt} for horizontal and vertical whitespaces.  
>  >
> > It's not just Java. Perl supports all 4 of \h, \H, \v and \V. That might 
> > be why Java 8 changed.
> > I've found that Perl has \p{HorizSpace} and \p{VertSpace}, so I'm going   
> with that.

+1 for special Unicode categories rather than retargetting existing
escapes for something else.

(also, matching horizontal/vertical whitespace sounds rather unusual)

Regards

Antoine.


___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/7XN73YFKX4CGMSZBP7D4D3GOQOQVH5NM/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Adding new escapes to regex module

2022-08-18 Thread Serhiy Storchaka

17.08.22 19:34, MRAB пише:
It's not just Java. Perl supports all 4 of \h, \H, \v and \V. That might 
be why Java 8 changed.


But Perl does not have conflict between strings and regular expressions, 
because regular expression is a separate syntax construct.


___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/V47KWBKWCTBBXM637VPPJTR3QD4C5S23/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Switching to Discourse

2022-08-18 Thread Baptiste Carvello
Le 18/07/2022 à 13:45, Baptiste Carvello a écrit :
> Le 15/07/2022 à 17:52, Petr Viktorin a écrit :
>>
>> For everything on Discourse, the RSS feed is at
>> https://discuss.python.org/latest.rss
>> For a specific categoriy/topic, append .rss to the Web URL.
> 
> [...]
> Is there a way to access all posts through the mail/RSS client,
> preferably with a threaded view?

TL;DR: almost there, but not there yet. A few fixes are needed in
Discourse for RSS to become a viable reading strategy.

Hi all,

reviving this old thread to try and answer my own question. For the last
month (which included a ten-day vacation), I've tried using core-dev.rss
or posts.rss (with Thunderbird). Both give a very frustrating feeling of
"almost there, but definitely not there yet":

* core-dev.rss: does its job at listing which topics get discussed. The
first post is usually enough to decide whether I'm interested or not.
Being a web browser below the surface, Thunderbird even has a "web page
mode" that permits reading the discourse thread page embedded in it
(much slower that text, but surprisingly without nag screens).

Except that threads older than a few days are scrubbed from the rss
file, even when the thread continues. So when I come back from vacation,
I not only lose past discussions (which is fair game), but also still
current ones.

Also, core-dev.rss can provide no indication when new activity happens
on a given thread, so I have to reopen them all in "web page mode"
(slow) just to check.

* posts.rss: can be used efficiently together with Thunderbird's sorting
features. I first sort by "date" to find current discussions, select an
interesting post, them sort by "object" to see the full thread.

The problem is with the volume. Not only are all messages included, but
Discourse doesn't provide the "category" rss tag, which Thunderbird
could use to tag the messages.

Adding a per-category posts.rss has been a feature request to Discourse
since 2016 [1], but "hasn’t happened yet", as the Discourse developers
put it. No patch was asked for, so I presume they just see the use case
as very unimportant.

[1]: https://meta.discourse.org/t/rss-feed-for-category-latest/37192

Perhaps someone with an official status in the Python community could
approach the Discourse developers and weight in so that:

* still current threads are not so aggressively scrubbed from core-dev.rss;

and/or
* "category" tags are added to posts.rss;

and/or
* per-category posts.rss are finally implemented.

Cheers,
Baptiste
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/UZJ27G57F7QJJ2LYBDGZQ5BIXLH7OXWJ/
Code of Conduct: http://python.org/psf/codeofconduct/