FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-105481: Mark more files as generated by brandtbucher · Pull Request #107598 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension dotfile  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 2 additions & 0 deletions .gitattributes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ Doc/library/token-list.inc generated
Include/internal/pycore_ast.h generated
Include/internal/pycore_ast_state.h generated
Include/internal/pycore_opcode.h generated
Include/internal/pycore_opcode_metadata.h generated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I removed this from the list a couple of weeks ago to make it show up in the diff, to make sure people are aware when the instruction flags change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Agreed, let’s keep it out of the list for. This can catch accidental mistakes, or remind people of the consequences of intentional changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe we should leave it there commented out with an explanation so this won't come up again.

brandtbucher Aug 3, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hm, really? I'm not sure I agree. This was prompted by the diff view of my recent PR, where it just adds noise.

We already hide other files with lists of tokens, keywords, and standard library module names that are arguably more important and more human-readable than this one. And people can still view them, GitHub just collapses them by default.

If we're this concerned about setting the correct flags, maybe we should just write some sort of test instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What test would you write?

brandtbucher Aug 3, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Well, I'm not really sure what we're trying to protect against here. My understanding is that the flags are now generated automatically by analyzing the DSL's C code. If there's a bug somewhere, it's probably in the static analysis of the code, not the code itself (if I add a GETLOCAL to something, then I definitely want it to set the has "local" flag, ditto for JUMPBY and the "jump" flag).

So maybe tests for InstructionFlags.fromInstruction with some expected inputs and outputs? Or some error-checking in the generator that incompatible flag combinations (like "local" and "jump", or "const" without "oparg") don't happen?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We could have a few of those. They would protect us from regressions when we change the static analysis code, or when we change the implementation of a bytecode that happens to be tested. But when you add a new bytecode, don't you want to look at that flags and see that they make sense?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

(I edited my comment above, adding that maybe the flags class could do some sanity checks on the flag combination.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

But honestly I thought this would be uncontroversial. If you're getting value from the status quo, I can let it go. I just got kind of tired of scrolling past this file in PRs.

Include/internal/pycore_*_generated.h generated
Include/opcode.h generated
Include/token.h generated
Lib/_opcode_metadata.py generated
Lib/keyword.py generated
Lib/test/levenshtein_examples.json generated
Lib/test/test_stable_abi_ctypes.py generated
Expand Down

Back | FazBrowse Home | New Git URL