mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:22:24 +00:00
Add a new script to generate builtin module names (#12696)
This commit is contained in:
parent
2393d19f91
commit
7ee7c68f36
7 changed files with 198 additions and 50 deletions
|
@ -39,6 +39,18 @@ pub enum TargetVersion {
|
|||
}
|
||||
|
||||
impl TargetVersion {
|
||||
pub const fn as_tuple(self) -> (u8, u8) {
|
||||
match self {
|
||||
Self::Py37 => (3, 7),
|
||||
Self::Py38 => (3, 8),
|
||||
Self::Py39 => (3, 9),
|
||||
Self::Py310 => (3, 10),
|
||||
Self::Py311 => (3, 11),
|
||||
Self::Py312 => (3, 12),
|
||||
Self::Py313 => (3, 13),
|
||||
}
|
||||
}
|
||||
|
||||
const fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
Self::Py37 => "py37",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue