Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compilers: Use keyword only arguments for compiler interfaces
Because we need to inherit them in some cases, and python's keyword-or-positional arguments make this really painful, especially with inheritance. They do this in two ways: 1) If you want to intercept the arguments you need to check for both a keyword and a positional argument, because you could get either. Then you need to make sure that you only pass one of those down to the next layer. 2) After you do that, if the layer below you decides to do the same thing, but uses the other form (you used keyword by the lower level uses positional or vice versa), then you'll get a TypeError since two layers down got the argument as both a positional and a keyword. All of this is bad. Fortunately python 3.x provides a mechanism to solve this, keyword only arguments. These arguments cannot be based positionally, the interpreter will give us an error in that case. I have made a best effort to do this correctly, and I've verified it with GCC, Clang, ICC, and MSVC, but there are other compilers like Arm and Elbrus that I don't have access to.
- Loading branch information
Showing
6 changed files
with
114 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.