Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions emrichen/tags/typeop.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from numbers import Number
from typing import Optional, Union
from typing import Optional, Type, Union

from ..context import Context
from ..void import Void, VoidType
Expand All @@ -12,8 +12,9 @@ class _BaseIsType(BaseTag):
example: "`!{name} ...`"
description: Returns True if the value enriched is of the given type, False otherwise.
"""
requisite_type = None

value_types = (object,)
requisite_type: Type
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pyrekt


def enrich(self, context: Context) -> bool:
return self.check(context.enrich(self.data))
Expand Down Expand Up @@ -67,4 +68,4 @@ class IsNone(_BaseIsType):
"""

def check(self, value: Optional[Union[VoidType, str]]) -> bool:
return (value is None or value is Void)
return value is None or value is Void
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black

7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@


with open(os.path.join(source_dir, 'emrichen', '__init__.py')) as f:
version = re.search("__version__ = ['\"]([^'\"]+)['\"]", f.read()).group(1)
init_file = f.read()
match = re.search("__version__ = ['\"]([^'\"]+)['\"]", init_file)
assert match, "Failed to parse version from emrichen/__init__.py"
version = match.group(1)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pyrekt



with open(os.path.join(source_dir, 'README.md'), encoding='utf-8') as f:
Expand All @@ -29,7 +32,7 @@
author='Santtu Pajukanta',
author_email='santtu@pajukanta.fi',
url='http://github.com/con2/emrichen',
packages = find_packages(exclude=["tests"]),
packages=find_packages(exclude=["tests"]),
zip_safe=True,
entry_points={
'console_scripts': [
Expand Down