[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: For named tuples, there isn't an include/exclude option, so no extra mention is warranted. -- nosy: +rhettinger ___ Python tracker ___

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-09 Thread Brandt Bucher
Brandt Bucher added the comment: If we end up adding a “match_args=False” option to the dataclass decorator (issue 43764), then the docs for that option would probably be sufficient for this purpose. I’m imagining something like the docs for the “init” option, just substituting

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-09 Thread Eric V. Smith
Eric V. Smith added the comment: I do think it's worth mentioning that __match_args__ is automatically generated by @dataclass (if the class doesn't already define __match_args__). That seems like behavior that's very specific to @dataclass. Where else would you find out that defining your

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: -rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-09 Thread Adrian Freund
Adrian Freund added the comment: I agree that __match_args__ shouldn't have to be added to the documentation of any class that supports it, however dataclass and (maybe to a lesser extend) NamedTuple aren't themselves classes, but aid in creating own classes. Their effects on classes

[issue43754] Eliminate bindings for partial pattern matches

2021-04-07 Thread Brandt Bucher
this that don't involve rewriting most of the pattern compiler. That way we can minimize potential merge conflicts. -- ___ Python tracker <https://bugs.python.org/issue43

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: > This change is currently not documented in the dataclass > and namedtuple documentation, I don't think we need to do that. In the end, __match_args__ will be added in many places. The right place to document it is in the pattern matchin

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-07 Thread Adrian Freund
Adrian Freund added the comment: Ok. I created https://bugs.python.org/issue43764 for that. -- ___ Python tracker ___ ___

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-07 Thread Eric V. Smith
Eric V. Smith added the comment: Turning off the generation of __match_args__ should be a separate issue. -- ___ Python tracker ___

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-07 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-07 Thread Adrian Freund
New submission from Adrian Freund : PEP 634 structural pattern matching adds an auto-generated __match_args__ attribute to classes with the dataclass decorator and to namedtuples. This change is currently not documented in the dataclass and namedtuple documentation, nor is it mentioned

[issue43754] Eliminate bindings for partial pattern matches

2021-04-06 Thread Brandt Bucher
New submission from Brandt Bucher : This draft PR contains a couple of pattern matching improvements I'm experimenting with. Most significantly, it implements behavior that several people requested during the PEP 634 feedback process: no more name bindings for partial matches. (One caveat

[issue43754] Eliminate bindings for partial pattern matches

2021-04-06 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +23966 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25229 ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-04-05 Thread Brandt Bucher
Brandt Bucher added the comment: New changeset f84d5a113680c5a6aaaf9130aed7a34d611748ff by Brandt Bucher in branch 'master': bpo-42128: __match_args__ can't be a list anymore (GH-25203) https://github.com/python/cpython/commit/f84d5a113680c5a6aaaf9130aed7a34d611748ff --

[issue42128] Structural Pattern Matching (PEP 634)

2021-04-05 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +23942 pull_request: https://github.com/python/cpython/pull/25203 ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-04-04 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +23927 pull_request: https://github.com/python/cpython/pull/25185 ___ Python tracker ___ ___

[issue43686] re.match appears to hang with certain combinations of pattern and string

2021-03-31 Thread Dennis Sweeney
Dennis Sweeney added the comment: It's well-known that regular expressions can take exponential time. You can try searching this bug tracker for "re exponential". Common suggestions are to try a third-party module, or to write better regexes where possible. Note that the important bits of

[issue43686] re.match appears to hang with certain combinations of pattern and string

2021-03-31 Thread Alexander Grigoriev
New submission from Alexander Grigoriev : Certain patterns and input strings cause re.match to take exponentially longer time. This can be expected because of recursive nature of matching some patterns, but it can take surprisingly long time with some combination of a pattern and input data

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-17 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 08fb8ac99ab03d767aa0f1cfab3573eddf9df018 by Pablo Galindo in branch 'master': bpo-42128: Add 'missing :' syntax error message to match statements (GH-24733)

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-15 Thread Brandt Bucher
Brandt Bucher added the comment: Actually, I didn't see that there are still 2 open linked PRs. I'll wait until those are merged. -- ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-15 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, feel free to close this issue. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-15 Thread Brandt Bucher
Brandt Bucher added the comment: Also, given that pattern matching is now shipped and documented, perhaps this issue should be closed? At this point I think dedicated issues are probably better for any new bugs/enhancements/etc. -- ___ Python

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-15 Thread Brandt Bucher
Brandt Bucher added the comment: Cool. Today or tomorrow I'll create an issue in Guido's patma repo and we can move our discussion there. I'll also create a branch and add you to my fork. -- ___ Python tracker

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-15 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > @BTaskaya, do you have any interest in helping me iterate on new AST nodes? Sure! -- ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-15 Thread Brandt Bucher
Brandt Bucher added the comment: @BTaskaya, do you have any interest in helping me iterate on new AST nodes? -- ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-12 Thread Brandt Bucher
Brandt Bucher added the comment: Yup, I agree we should explore this area further. See my comment here on Adrian’s mypy PR: https://github.com/python/mypy/pull/10191#issuecomment-797841945 -- ___ Python tracker

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-12 Thread Guido van Rossum
Guido van Rossum added the comment: This does point out that the ast structure is a liability, and we won't be able to easily change it, since mypy and IIRC many linters use the ast module. So I think that maybe we need to think more carefully about what the *proper* ast structure is, rather

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-12 Thread Brandt Bucher
Brandt Bucher added the comment: Not a much thought went into that decision, honestly. The main reason I chose an identifier there was because "as" always stores a simple name, so allowing it to potentially be other contexts or expressions (which are illegal) just seemed to create

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-12 Thread Adrian Freund
Adrian Freund added the comment: Thanks for the response. Looks like I overlooked the imports, global, nonlocal, ... because I only searched for usages of identifier, but they use lists of identifiers. In that case I agree that it isn't inconsistent. --

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-12 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > This seams really inconsistent with the rest of the ast, where identifiers > are always wrapped in a ast.Name object. The only other exception to this is > ast.Attribute. import ... as from ... import ... as try: ... except ... as : ... global

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-12 Thread Adrian Freund
Adrian Freund added the comment: For the last few days I've been working with pattern matching and it's ast for a bit, while trying to add support for it to mypy. During this I noticed an inconsistency in the ast: ast.MatchAs has an attribute name which is of type identifier (in C) and type

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-06 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- pull_requests: +23539 pull_request: https://github.com/python/cpython/pull/24771 ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 0632b1012d4dfa81ffef0d686a4710f6134f77a8 by Pablo Galindo in branch 'master': bpo-42128: Add __match_args__ to structseq-based classes (GH-24732) https://github.com/python/cpython/commit/0632b1012d4dfa81ffef0d686a4710f6134f77a8

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-03 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +23504 pull_request: https://github.com/python/cpython/pull/24733 ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Opened https://github.com/python/cpython/pull/24732 > I'm also not entirely sure how "unnamed fields" work, or what they're used > for. Presumably, we'd want to end the __match_args__ tuple upon hitting one > of these? AFAIK, they should be just

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-03 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +23503 pull_request: https://github.com/python/cpython/pull/24732 ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-03 Thread Brandt Bucher
Brandt Bucher added the comment: Yeah, probably. I'm not too familiar with the design of those objects... would it make more sense to have the implementation be a single descriptor shared by all derived types, or should we precompute the tuple of strings when each new type is defined? I'm

[issue43378] Pattern Matching section in tutorial refers to | as or

2021-03-03 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +Daniel Moisset, brandtbucher, gvanrossum, willingc ___ Python tracker ___ ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: Should __match_args__ be added to Objects/structseq.c ? -- nosy: +rhettinger ___ Python tracker ___

[issue43378] Pattern Matching section in tutorial refers to | as or

2021-03-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Another other thought, PEP 634 defines "|" as being an "or-pattern", so it part of the spec: https://www.python.org/dev/peps/pep-0634/#or-patterns -- ___ Python tracker <https://bug

[issue43378] Pattern Matching section in tutorial refers to | as or

2021-03-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: This seems fine to me. In pattern matching, it has both the meaning and pronunciation of "or": case "this" | "that": ... It has similar mean in the re module: r'abc|def' And it is also used the same way in typi

Python 3.10.0a6 is available, now with 100% more pattern matching

2021-03-02 Thread Pablo Galindo Salgado
Remember us? It's your friendly CPython release team and we have something we think you may like: The new alpha release of Python 3.10 is here, now with 100% more pattern matching. If I were you, I would download it and start playing with it. Extra points if you report us any bugs you find along

Python 3.10.0a6 is available, now with 100% more pattern matching

2021-03-02 Thread Pablo Galindo Salgado
Remember us? It's your friendly CPython release team and we have something we think you may like: The new alpha release of Python 3.10 is here, now with 100% more pattern matching. If I were you, I would download it and start playing with it. Extra points if you report us any bugs you find along

[issue43378] Pattern Matching section in tutorial refers to | as or

2021-03-02 Thread Luciano Ramalho
New submission from Luciano Ramalho : Section 4.6. "match Statements" of the Python 3.10 tutorial says: """ You can combine several literals in a single pattern using | (“or”): """ For someone just learning Python, this may suggest that | is always &quo

[issue43378] Pattern Matching section in tutorial refers to | as

2021-03-02 Thread Luciano Ramalho
Change by Luciano Ramalho : -- nosy: ramalho priority: normal severity: normal status: open title: Pattern Matching section in tutorial refers to | as ___ Python tracker <https://bugs.python.org/issue43

[RELEASE] Python 3.10.0a6 is available, now with 100% more pattern matching

2021-03-02 Thread Pablo Galindo Salgado
Remember us? It's your friendly CPython release team and we have something we think you may like: The new alpha release of Python 3.10 is here, now with 100% more pattern matching. If I were you, I would download it and start playing with it. Extra points if you report us any bugs you find along

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-02 Thread Brandt Bucher
Brandt Bucher added the comment: I'm currently working on some performance benchmarks for PEP 634: https://github.com/brandtbucher/patmaperformance Hopefully they will help inform future improvements. I already have benchmarks for class patterns and mapping patterns, and am still searching

[RELEASE] Python 3.10.0a6 is available, now with 100% more pattern matching

2021-03-02 Thread Pablo Galindo Salgado
Remember us? It's your friendly CPython release team and we have something we think you may like: The new alpha release of Python 3.10 is here, now with 100% more pattern matching. If I were you, I would download it and start playing with it. Extra points if you report us any bugs you find along

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-28 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset a22bca6b1e2f3dc11a58f3e5ef5c22e26b8a2d80 by Daniel F Moisset in branch 'master': bpo-42128: Add documentation for pattern matching (PEP 634) (#24664) https://github.com/python/cpython/commit/a22bca6b1e2f3dc11a58f3e5ef5c22e26b8a2d80

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-28 Thread Carol Willing
Carol Willing added the comment: New changeset a8e2615aa885a121b8cf8e9cd07696207356a25a by Pablo Galindo in branch 'master': bpo-42128: Add documentation for the new match-based AST nodes (GH-24673) https://github.com/python/cpython/commit/a8e2615aa885a121b8cf8e9cd07696207356a25a

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-28 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +23458 pull_request: https://github.com/python/cpython/pull/24673 ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-28 Thread Brandt Bucher
Brandt Bucher added the comment: Thanks Pablo! > If you'd like to take it on feel free, if not I'll create a PR next weekend > with tests (probably after release, though I believe it is not a blocker as > is). No problem, I'm pretty busy too. Next weekend is fine. --

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I can pick up the AST docs PR -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-28 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > @BTaskaya, do you think you'll have time to open a PR with your AST validator > this weekend? It looks good to me (assuming tests pass). Unfortunately not. I believe it still lacks tests for invalid cases, but other than that should work. If you'd like

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-28 Thread Brandt Bucher
Brandt Bucher added the comment: @BTaskaya, do you think you'll have time to open a PR with your AST validator this weekend? It looks good to me (assuming tests pass). Also, we should add the AST docs to our documentation to-do list (should be just adding entries for ast.Match, ast.MatchAs,

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-27 Thread Carol Willing
Carol Willing added the comment: Folks, The What's New PR is open now. I've tried to focus more on the data type/shape examples over literal example. -- ___ Python tracker

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-27 Thread Carol Willing
Change by Carol Willing : -- pull_requests: +23452 pull_request: https://github.com/python/cpython/pull/24667 ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-27 Thread Daniel Moisset
Change by Daniel Moisset : -- pull_requests: +23450 pull_request: https://github.com/python/cpython/pull/24664 ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-27 Thread Daniel Moisset
Daniel Moisset added the comment: Thanks @xtreak, I'll make some changes in these sections too. The docs are coming along well, there's still some refinement to do in the compound statements section (it's there, but looks to big), I'll submit a draft PR during the weekend so interested

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-26 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I am not sure if this was mentioned. There are a couple of places where switch/case is mentioned in the docs and it will be good if these places were updated to the tutorial or PEP.

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-26 Thread Brandt Bucher
Brandt Bucher added the comment: New changeset 145bf269df3530176f6ebeab1324890ef7070bf8 by Brandt Bucher in branch 'master': bpo-42128: Structural Pattern Matching (PEP 634) (GH-22917) https://github.com/python/cpython/commit/145bf269df3530176f6ebeab1324890ef7070bf8

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-20 Thread Daniel Moisset
Daniel Moisset added the comment: Note: I will NOT write something for "What's New in 3.10" seeing that's in progress -- ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-20 Thread Daniel Moisset
Daniel Moisset added the comment: Fyi, I'm looking into the documentation. I think I can have something basic for the middle of this week, so it should be ok for March 1st. -- ___ Python tracker

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Carol Willing
Carol Willing added the comment: Absolutely, I can help do that. On Fri, Feb 19, 2021 at 9:14 PM Guido van Rossum wrote: > > Guido van Rossum added the comment: > > Carol, the most urgent thing we have going is to come up with text for > what's new. I posted a PR that adds my standard

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: Carol, the most urgent thing we have going is to come up with text for what's new. I posted a PR that adds my standard "quick" tutorial ( https://github.com/python/cpython/pull/24588) which is also found in Appendix A of PEP 636 (the tutorial PEP -- the

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Carol Willing
Carol Willing added the comment: @Brandt Bucher @Guido van Rossum I'm finally getting some free time to get the docs workgroup up and running. I'm happy to help with any docs that you want for alpha and beyond. On Fri, Feb 19, 2021 at 8:27 PM Guido van Rossum wrote: > > Guido van Rossum

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: But seriously, nothing good can come from social media. It's what drove me to retire in 2018. Just ignore it please. -- ___ Python tracker

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: Okay, I see. Clearly we should have kept the "DWIM" option, aka "If it starts with a capital letter, it's a value pattern." :-) -- ___ Python tracker <https://bug

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread laurenjl
laurenjl added the comment: > I've seen too many knee-jerk reactions over the past weeks along the lines of > "the new switch feature can't handle named constants!". Here are some that I found interesting: https://twitter.com/jakevdp/status/1359870794877132810

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: Let's continue this at https://github.com/python/cpython/pull/24588 -- ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Brandt Bucher
Brandt Bucher added the comment: I understand. I would just like to see something that won't give new Python pattern-matching users (read: everybody) the very painful first impression that this is a switch. Can we rework it like: match input().split(): case []: print(&quo

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Guido van Rossum
at's new IMO, and also a bit unfinished. It is meant as a gentle intro. The Appendix is meant as an intro to pattern matching for experienced Python users (the kind of people for whom the what's new series of documents is written). This tutorial takes the user from the simplest forms of

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Guido van Rossum
Change by Guido van Rossum : -- pull_requests: +23368 pull_request: https://github.com/python/cpython/pull/24588 ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Brandt Bucher
Brandt Bucher added the comment: > Would people be okay if I added the tutorial from Appendix A of PEP 636 to > Doc/whatsnew/3.10.rst? Yes please! It's not a huge deal, but I vote that we either drop or rework the "http_error" examples. I think it gives people a very wrong first impression

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: I don't know who's really in charge of the docs. I suppose the PEP authors are, collectively, but that runs the risk that we're all expecting the person to our left in the circle to do it. Would people be okay if I added the tutorial from Appendix A of PEP

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Brandt Bucher
Brandt Bucher added the comment: To the folks working on docs: Does it seem realistic to have something ready by the next alpha (March 1st)? I'd like to at least have a What's New entry and a rough draft tutorial by then, since we'll probably (hopefully?) have a bunch of users jumping on

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-09 Thread Daniel Moisset
Daniel Moisset added the comment: @Ken: I've invited you to the repo. For tracking the WIP, https://github.com/dmoisset/cpython/tree/patma-docs Do you want to see if you can base the reference/compound_stmts.rst changes in PEP 634? I'll try to fit a variant of the Appendix A of PEP 636 into

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-09 Thread Brandt Bucher
Brandt Bucher added the comment: Also, see my msg379831 above. We can't entirely rely on the PEPs, of course, but I think we could still get some decent reuse out of them. BTW, has the new docs WG started up yet? I keep hearing about it every once in a while, but I'm not sure if it's

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-09 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: The grammar is indeed auto-generated by reading the actual Grammar file, python.gram. Here's the lexer Pablo had developed for doing the syntax-highlighting. https://github.com/python/cpython/blob/master/Doc/tools/extensions/peg_highlight.py --

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-09 Thread Ken Jin
Ken Jin added the comment: Hi Daniel, wow thanks for the offer! My GitHub username is Fidget-Spinner. I'm not sure about the grammar file either. Oh, thanks for mentioning the tutorial recommendation by the SC, I'll keep that in mind.  -- ___

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-09 Thread Daniel Moisset
Daniel Moisset added the comment: Hey Ken, I was about to take on this myself, but I wouldn't mind a bit of help. Your list seems ok, I would add to it a section about PM in the python tutorial (which was explicitly mentioned in the SC acceptance notice). Regarding the grammar, I believe

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-09 Thread Ken Jin
Ken Jin added the comment: Guido and Brandt, may I take a stab at the docs for this? I'll probably base most of it off PEP 636's tutorial. Relevant parts of the docs that I've identified: reference/lexical_analysis.rst reference/compound_stmts.rst reference/grammar.rst # this probably needs

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-08 Thread Guido van Rossum
Guido van Rossum added the comment: The PEP has been accepted. I propose that we use separate PRs for docs (and incremental improvements to the code) but tie them all together using the same issue number (this will require adding "skip news" to later PRs). --

asyncio cancellation pattern

2020-12-28 Thread Joseph L. Casale
I've started writing some asyncio code in lieu of using threads and managing concurrency and primitives manually. Having spent a lot of time using c#'s async implementation, I am struggling to see an elegant pattern for implementing cancellation. With the necessity for the loop (that of which I

[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2020-12-04 Thread Guido van Rossum
Guido van Rossum added the comment: Wait, is the OP maybe that there’s a difference between typeshed an the stdlib typing.py? -- ___ Python tracker ___

[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2020-12-04 Thread Walter Dörwald
Walter Dörwald added the comment: Shadowing the real modules `re` and `io` by from typing import * would indeed be bad, but that argument IMHO doesn't hold for the types `IO`, `TextIO` and `BinaryIO`, yet they are not listed in `typing.__all__`. Is there a reason for that? And if not,

[issue42475] wrongly cache pattern by re.compile

2020-11-26 Thread Matthew Barnett
Matthew Barnett added the comment: That behaviour has nothing to do with re. This line: samples = filter(lambda sample: not pttn.match(sample), data) creates a generator that, when evaluated, will use the value of 'pttn' _at that time_. However, you then bind 'pttn' to something else.

[issue42475] wrongly cache pattern by re.compile

2020-11-26 Thread ProFatXuanAll
: wrongly cache pattern by re.compile type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49625/rebug.py ___ Python tracker <https://bugs.python.org/issue42

[issue42128] Structural Pattern Matching (PEP 634)

2020-10-28 Thread Brandt Bucher
Brandt Bucher added the comment: I'll wait till the SC makes a ruling, then send a message to our docs list (I think we have one)? I'm fine coordinating/reviewing that, or making PRs myself if nobody else steps up. -- ___ Python tracker

[issue42128] Structural Pattern Matching (PEP 634)

2020-10-28 Thread Guido van Rossum
Guido van Rossum added the comment: If you feel up to it, you might see if you could open a new, separate (draft) PR that updates all those docs. (But you could also wait and see if someone volunteers. There are some good doc writers active ATM.) --

[issue42128] Structural Pattern Matching (PEP 634)

2020-10-28 Thread Brandt Bucher
Brandt Bucher added the comment: Thinking ahead... A lot of work has gone into writing these PEPs... we should see how much we can easily convert into actual docs. It seems to me: - Parts of PEP 634 and PEP 635 can be worked into the language reference. - Guido's overview (the appendix of

[issue42128] Structural Pattern Matching (PEP 634)

2020-10-23 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +21846 pull_request: https://github.com/python/cpython/pull/22917 ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2020-10-23 Thread Brandt Bucher
Brandt Bucher added the comment: Sorry, just resolving some changes with master. Are you parser people finished breaking my grammar yet? Sheesh. ;) -- ___ Python tracker ___

[issue42128] Structural Pattern Matching (PEP 634)

2020-10-23 Thread Brandt Bucher
there. -- assignee: brandtbucher components: Interpreter Core messages: 379442 nosy: BTaskaya, brandtbucher, gvanrossum, lys.nikolaou, pablogsal priority: normal severity: normal stage: patch review status: open title: Structural Pattern Matching (PEP 634) type: enhancement versions: Python 3.10

[issue31202] Windows pathlib.Path.glob(pattern) fixed part of the pattern changed to lowercase whereas it should be unchanged.

2020-10-16 Thread Steve Dower
Steve Dower added the comment: Yeah, looks done. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue31202] Windows pathlib.Path.glob(pattern) fixed part of the pattern changed to lowercase whereas it should be unchanged.

2020-10-16 Thread Brice Gros
Brice Gros added the comment: I think so, the original PR has been ported to 3.9, 3.8, 3.7, and all the PRs were merged. -- ___ Python tracker ___

[issue31202] Windows pathlib.Path.glob(pattern) fixed part of the pattern changed to lowercase whereas it should be unchanged.

2020-10-16 Thread Irit Katriel
Irit Katriel added the comment: Can this be closed? -- nosy: +iritkatriel ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue40119] ensurepip should use different pattern for pip/setuptool wheel files

2020-06-15 Thread Ned Deily
Ned Deily added the comment: Thanks for the report. This issue has been resolved in 5f79f46612c351bde78a41c5264c42db21008868 (and backports) for Issue38488 which upgraded ensurepip to newer versions of pip and setuptools. -- nosy: +ned.deily resolution: -> duplicate stage: ->

[issue40363] shlex.quote applied to a glob pattern disables glob matching

2020-04-22 Thread Eric V. Smith
Eric V. Smith added the comment: I meant to add: it's possible that this isn't well documented. -- ___ Python tracker ___ ___

[issue40363] shlex.quote applied to a glob pattern disables glob matching

2020-04-22 Thread Eric V. Smith
Eric V. Smith added the comment: Agreed that shlex.quote is working as intended. It's goal is to pass something to the shell, preserving it just as you started with it. It exists exactly because you want to avoid shell globbing and parsing issues (consider filenames that contain spaces and

<    1   2   3   4   5   6   7   8   9   10   >