Skip to content

Refactor default PartitionTable - #4689

Merged
svartkanin merged 1 commit into
archlinux:masterfrom
codefiles:ref-default-partitiontable
Aug 3, 2026
Merged

Refactor default PartitionTable#4689
svartkanin merged 1 commit into
archlinux:masterfrom
codefiles:ref-default-partitiontable

Conversation

@codefiles

Copy link
Copy Markdown
Contributor

Addresses the following:

pyright

  archinstall/lib/models/device.py:262:10 - error: Type "Literal[PartitionTable.GPT, PartitionTable.MBR]" is not assignable to return type "Self@PartitionTable"
    Type "Literal[PartitionTable.GPT, PartitionTable.MBR]" is not assignable to type "Self@PartitionTable" (reportReturnType)

ty

error[invalid-return-type]: Return type does not match returned value
   --> archinstall/lib/models/device.py:261:22
    |
261 |     def default(cls) -> Self:
    |                         ---- Expected `Self@default` because of return type
262 |         return cls.GPT if SysInfo.has_uefi() else cls.MBR
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self@default`, found `PartitionTable`
    |

@codefiles
codefiles requested a review from Torxed as a code owner August 2, 2026 12:16
@codefiles

Copy link
Copy Markdown
Contributor Author

The Pylint check is stuck so I'm going to force push to trigger a re-run.

Addresses the following:

pyright

```
  archinstall/lib/models/device.py:262:10 - error: Type "Literal[PartitionTable.GPT, PartitionTable.MBR]" is not assignable to return type "Self@PartitionTable"
    Type "Literal[PartitionTable.GPT, PartitionTable.MBR]" is not assignable to type "Self@PartitionTable" (reportReturnType)
```

ty

```
error[invalid-return-type]: Return type does not match returned value
   --> archinstall/lib/models/device.py:261:22
    |
261 |     def default(cls) -> Self:
    |                         ---- Expected `Self@default` because of return type
262 |         return cls.GPT if SysInfo.has_uefi() else cls.MBR
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self@default`, found `PartitionTable`
    |
```
@codefiles
codefiles force-pushed the ref-default-partitiontable branch from dc98efb to 1b29060 Compare August 2, 2026 12:43
@svartkanin
svartkanin merged commit 0d6ffc3 into archlinux:master Aug 3, 2026
11 checks passed
@codefiles
codefiles deleted the ref-default-partitiontable branch August 3, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants