Skip to content

Commit

Permalink
Update type annotations to pass strict mypy check (refs #118)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfx committed Apr 20, 2024
1 parent b692975 commit e75c898
Show file tree
Hide file tree
Showing 5 changed files with 204 additions and 170 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
uses: jpetrucciani/mypy-check@master
with:
path: './src/fileseq'
mypy_flags: '--no-implicit-reexport --strict'

deploy:
if: github.event_name == 'release' && github.event.action == 'published'
Expand Down
9 changes: 5 additions & 4 deletions src/fileseq/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import re
import typing

# The max frame count of a FrameSet before a MaxSizeException
# exception is raised
Expand All @@ -13,16 +14,16 @@ class _PadStyle(object):
def __init__(self, name: str):
self.__name = name

def __hash__(self):
def __hash__(self) -> int:
return hash(str(self))

def __repr__(self):
def __repr__(self) -> str:
return '<PAD_STYLE: {}>'.format(self.__name)

def __str__(self):
def __str__(self) -> str:
return self.__name

def __eq__(self, other):
def __eq__(self, other: typing.Any) -> bool:
if not isinstance(other, _PadStyle):
return False
return str(self) == str(other)
Expand Down
Loading

0 comments on commit e75c898

Please sign in to comment.