[ACEM] mypy x llteacher#16
Closed
automaticcodeevolutionmanagement[bot] wants to merge 1 commit intomainfrom
Closed
[ACEM] mypy x llteacher#16automaticcodeevolutionmanagement[bot] wants to merge 1 commit intomainfrom
automaticcodeevolutionmanagement[bot] wants to merge 1 commit intomainfrom
Conversation
Policy: Mypy 1.19.1 Fixed: 7 violations Original Violations: src/homeworks/views.py: src/homeworks/views.py:373: error: Incompatible types in assignment (expression has type "type[BaseFormSet[Any]]", variable has type "type[SectionFormSet]") [assignment] src/homeworks/views.py:398: error: Incompatible types in assignment (expression has type "type[BaseFormSet[Any]]", variable has type "type[SectionFormSet]") [assignment] src/courses/views.py: src/courses/views.py:467: error: Incompatible types in assignment (expression has type "UUID", target has type "str | bytes") [assignment] Automated by ACEM - Initiative #18
automaticcodeevolutionmanagement bot
pushed a commit
that referenced
this pull request
Mar 17, 2026
Policy: Mypy 1.19.1 Fixed: 6 violations Original Violations: src/homeworks/views.py: src/homeworks/views.py:373: error: Incompatible types in assignment (expression has type "type[BaseFormSet[Any]]", variable has type "type[SectionFormSet]") [assignment] src/homeworks/views.py:398: error: Incompatible types in assignment (expression has type "type[BaseFormSet[Any]]", variable has type "type[SectionFormSet]") [assignment] src/courses/views.py: src/courses/views.py:467: error: Incompatible types in assignment (expression has type "UUID", target has type "str | bytes") [assignment] Automated by ACEM - Initiative #16
automaticcodeevolutionmanagement bot
pushed a commit
that referenced
this pull request
Mar 17, 2026
Policy: Mypy 1.19.1 Fixed: 5 violations Original Violations: src/llm/services.py: src/llm/services.py:389: error: Item "ChatCompletionMessageCustomToolCall" of "ChatCompletionMessageFunctionToolCall | ChatCompletionMessageCustomToolCall" has no attribute "function" [union-attr] src/llm/services.py:393: error: Item "ChatCompletionMessageCustomToolCall" of "ChatCompletionMessageFunctionToolCall | ChatCompletionMessageCustomToolCall" has no attribute "function" [union-attr] src/llm/services.py:399: error: Item "ChatCompletionMessageCustomToolCall" of "ChatCompletionMessageFunctionToolCall | ChatCompletionMessageCustomToolCall" has no attribute "function" [union-attr] src/llm/services.py:881: error: Item "tuple[str | Any, ...]" of "tuple[str, Any] | ChatCompletionChunk" has no attribute "choices" [union-attr] src/llm/services.py:882: error: Item "tuple[str | Any, ...]" of "tuple[str, Any] | ChatCompletionChunk" has no attribute "choices" [union-attr] Automated by ACEM - Initiative #16
automaticcodeevolutionmanagement bot
pushed a commit
that referenced
this pull request
Mar 18, 2026
Policy: Mypy 1.19.1 Fixed: 6 violations Original Violations: src/homeworks/views.py: src/homeworks/views.py:373: error: Incompatible types in assignment (expression has type "type[BaseFormSet[Any]]", variable has type "type[SectionFormSet]") [assignment] src/homeworks/views.py:398: error: Incompatible types in assignment (expression has type "type[BaseFormSet[Any]]", variable has type "type[SectionFormSet]") [assignment] src/courses/views.py: src/courses/views.py:467: error: Incompatible types in assignment (expression has type "UUID", target has type "str | bytes") [assignment] Automated by ACEM - Initiative #16
automaticcodeevolutionmanagement bot
pushed a commit
that referenced
this pull request
Mar 18, 2026
Policy: Mypy 1.19.1 Fixed: 5 violations Original Violations: src/llm/services.py: src/llm/services.py:389: error: Item "ChatCompletionMessageCustomToolCall" of "ChatCompletionMessageFunctionToolCall | ChatCompletionMessageCustomToolCall" has no attribute "function" [union-attr] src/llm/services.py:393: error: Item "ChatCompletionMessageCustomToolCall" of "ChatCompletionMessageFunctionToolCall | ChatCompletionMessageCustomToolCall" has no attribute "function" [union-attr] src/llm/services.py:399: error: Item "ChatCompletionMessageCustomToolCall" of "ChatCompletionMessageFunctionToolCall | ChatCompletionMessageCustomToolCall" has no attribute "function" [union-attr] src/llm/services.py:881: error: Item "tuple[str | Any, ...]" of "tuple[str, Any] | ChatCompletionChunk" has no attribute "choices" [union-attr] src/llm/services.py:882: error: Item "tuple[str | Any, ...]" of "tuple[str, Any] | ChatCompletionChunk" has no attribute "choices" [union-attr] Automated by ACEM - Initiative #16
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mypy x llteacher
What This PR Does
Mypy identified incompatible type assignments where Django's
formset_factoryreturned a genericBaseFormSetinstead of the expectedSectionFormSet, along with unhandled optional types and UUID-to-string mismatches. Left unresolved, these type ambiguities compromise strict type safety and could cause unpredictable runtime errors when accessing specialized attributes or processing form data. To fix these errors, we removed incorrect type hints on formset factories, introduced explicitisinstanceand null assertions to validate types at runtime, and properly casted the course ID to a string.Details
Original Violations
src/homeworks/views.py
src/courses/views.py
This pull request was automatically created by ACEM.