Skip to content

Commit c4e0ece

Browse files
authored
Merge pull request #2 from pomponchik/develop
0.0.3
2 parents 3e6567a + d1ecab8 commit c4e0ece

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
12+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
1313

1414
steps:
1515
- uses: actions/checkout@v2

.github/workflows/tests_and_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [macos-latest, ubuntu-latest, windows-latest]
13-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
13+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
1414

1515
steps:
1616
- uses: actions/checkout@v2

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
1212
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
1313

14+
1415
The [transfunctions](https://github.com/pomponchik/transfunctions) library introduces a new type of function: `superfunction`. They can behave both as regular and asynchronous functions, depending on the context, that is, on how the user uses them. This micro-library demonstrates the smallest example of this concept that I could come up with.
1516

1617
Install it:

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "supertime"
7-
version = "0.0.2"
7+
version = "0.0.3"
88
authors = [
99
{ name="Evgeniy Blinov", email="zheni-b@yandex.ru" },
1010
]
1111
description = 'A living example of superfunctions'
1212
readme = "README.md"
1313
requires-python = ">=3.8"
1414
dependencies = [
15-
'transfunctions==0.0.7',
15+
'transfunctions==0.0.8',
1616
'typing_extensions ; python_version <= "3.9"',
1717
]
1818
classifiers = [
@@ -28,6 +28,7 @@ classifiers = [
2828
'Programming Language :: Python :: 3.11',
2929
'Programming Language :: Python :: 3.12',
3030
'Programming Language :: Python :: 3.13',
31+
'Programming Language :: Python :: 3.14',
3132
'License :: OSI Approved :: MIT License',
3233
'Intended Audience :: Developers',
3334
'Topic :: Software Development :: Libraries',

supertime/function.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from asyncio import sleep as async_sleep
22
from time import sleep as sync_sleep
3+
from typing import Union, NoReturn
34

45
from transfunctions import superfunction, sync_context, async_context, await_it
56

67

7-
@superfunction(tilde_syntax=False) # type: ignore[misc]
8-
def supersleep(number: int) -> None:
8+
@superfunction(tilde_syntax=False)
9+
def supersleep(number: Union[int, float]) -> NoReturn: # type: ignore[misc]
910
with sync_context: # pragma: no cover
1011
sync_sleep(number)
11-
1212
with async_context: # pragma: no cover
1313
await_it(async_sleep(number))

0 commit comments

Comments
 (0)