Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError while importing tcmb 0.4.0 #14

Closed
sametsoekel opened this issue Apr 30, 2024 · 3 comments · Fixed by #16
Closed

TypeError while importing tcmb 0.4.0 #14

sametsoekel opened this issue Apr 30, 2024 · 3 comments · Fixed by #16
Assignees
Labels
bug Something isn't working

Comments

@sametsoekel
Copy link

import tcmb

raises this error in Python 3.9.12;


def wildcard_search(
pattern: str, items: list | None = None, use_package_data: bool = True
) -> list:
 """Search for items using regex pattern that can contain wildcard characters.
 
Parameters
(...)

 """
if items is None:

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

This syntax is only supported for Python 3.10 or later.

Can you please replace this function parts with typing.Optional for Python version compatibility ? (example)

Since I got a live app that works depending on your package, I can at least create a PR if you let me know.

Thanks

@kaymal kaymal added the bug Something isn't working label Apr 30, 2024
@kaymal kaymal self-assigned this Apr 30, 2024
@kaymal
Copy link
Owner

kaymal commented Apr 30, 2024

Thanks @sametsoekel ! I'll add from __future__ import annotations to make Union operator available for earlier versions of Python.

@kaymal
Copy link
Owner

kaymal commented Apr 30, 2024

I've fixed this one, however feel free to create a PR for any issues or features in the future @sametsoekel .

@sametsoekel
Copy link
Author

agreed ! 🤝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants