Skip to content

PEP 701 – Syntactic formalization of f-strings #102856

Activity

pablogsal

pablogsal commented on Mar 20, 2023

@pablogsal
MemberAuthor
pablogsal

pablogsal commented on Mar 20, 2023

@pablogsal
MemberAuthor

See this for the latest report on errors from @isidentical

pablogsal

pablogsal commented on Mar 20, 2023

@pablogsal
MemberAuthor

Draft PR for the C tokenizer up: #102855

pablogsal

pablogsal commented on Mar 20, 2023

@pablogsal
MemberAuthor

Things for the cleanup of #102855:

  • Cleaning up the grammar and the action helpers (the names are still ridiculous and there are multiple rules commented out).
    Remove the old parsing code and check that we didn't break anything 😅
    Clean/refactor the tokenizer struct (better names, factor stuff into its own structure as needed).
    Consider factoring out tok_get_fstring_mode because is a monster.
pablogsal

pablogsal commented on Mar 20, 2023

@pablogsal
MemberAuthor

Ok with #102855 we have the following failing tests:

  • test_ast
    test_cmd_line_script
    test_eof
    test_exceptions
    test_fstring
    test_tokenize
    test_type_comments
    test_unparse

Most of these are updating error messages, line numbers and other stuff but some may have actual bugs so we should check them. Please, mention which ones are you working on so we don't clash with one another.

mgmacias95

mgmacias95 commented on Mar 20, 2023

@mgmacias95
Contributor

Working on test_tokenize

Eclips4

Eclips4 commented on Mar 21, 2023

@Eclips4
Member

Hello, Pablo!
Can I get work on test_ast?
Recently I sent some PR's about this file (for example, #102797). So, I have some experience in that =)

ramvikrams

ramvikrams commented on Mar 21, 2023

@ramvikrams
Contributor

I can work with test_type_comments and test_unparse.

pablogsal

pablogsal commented on Mar 21, 2023

@pablogsal
MemberAuthor

@Eclips4 @ramvikrams wonderful! Just make PRs against my fork!

Report here or ping any of us if you find something that could be a bug (don't just fix the tests blindly because there may be bugs lurking).

pablogsal

pablogsal commented on Mar 21, 2023

@pablogsal
MemberAuthor

@lysnikolaou can you work on cleaning up the grammar + the actions?

@isidentical can you work on cleaning up some of the tokenizer layers? (This is quite a lot so we can probably work together here).

Eclips4

Eclips4 commented on Mar 21, 2023

@Eclips4
Member

@pablogsal
About test_ast.py
Seems thats like there only a one test will be failed, and how I undestand, that's a bug:

with self.assertRaises(SyntaxError):
ast.parse('f"{x=}"', feature_version=(3, 7))

I think, there's two solutions:

  1. Remove this test, because support of python3.7 will be ended soon.
  2. Now errors raised by tokenizer.c instead of string_parser.c, so as I understand, we should change python_gram, is it right? ( We need access to feature_version, which in tokenizer inaccessible )
pablogsal

pablogsal commented on Mar 21, 2023

@pablogsal
MemberAuthor

2. Now errors raised by tokenizer.c instead of string_parser.c, so as I understand, we should change python_gram, is it right? ( We need access to feature_version, which in tokenizer inaccessible )

Probably we can do this but on the other hand I would prefer to not overcomplicate this so I think (1) is better

lysnikolaou

lysnikolaou commented on Mar 21, 2023

@lysnikolaou
Member

@lysnikolaou can you work on cleaning up the grammar + the actions?

Will do!

Eclips4

Eclips4 commented on Mar 21, 2023

@Eclips4
Member

Also, I can take a look at test_cmd_line_script. Seems easy.

73 remaining items

added a commit that references this issue on May 24, 2023
added 2 commits that reference this issue on May 24, 2023
added a commit that references this issue on May 24, 2023
added a commit that references this issue on May 24, 2023
added a commit that references this issue on May 24, 2023
flying-sheep

flying-sheep commented on Oct 2, 2023

@flying-sheep
Contributor

Ah great! I didn't know someone would continue PEP 536. Happy that it's happening!

Shouldn't PEP 536 be mentioned in this one?

pablogsal

pablogsal commented on Oct 3, 2023

@pablogsal
MemberAuthor

Ah great! I didn't know someone would continue PEP 536. Happy that it's happening!

Shouldn't PEP 536 be mentioned in this one?

It's mentioned in the PEP:

https://peps.python.org/pep-0701/

Btw as heads up: We don't monitor normally closed issues so is very likely that people won't answer to comments when the issue is closed :)

flying-sheep

flying-sheep commented on Oct 3, 2023

@flying-sheep
Contributor

Thanks! Seems like I missed the mention then. Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @flying-sheep@mgmacias95@pablogsal@lysnikolaou@isidentical

        Issue actions

          PEP 701 – Syntactic formalization of f-strings · Issue #102856 · python/cpython