annotate 2.5.0__tar.gz → 2.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {annotate-2.5.0 → annotate-2.5.2}/CHANGES.rst +7 -1
- {annotate-2.5.0/src/annotate.egg-info → annotate-2.5.2}/PKG-INFO +10 -9
- {annotate-2.5.0 → annotate-2.5.2}/README.rst +8 -8
- {annotate-2.5.0 → annotate-2.5.2}/noxfile.py +8 -8
- {annotate-2.5.0 → annotate-2.5.2}/pyproject.toml +17 -16
- annotate-2.5.2/src/annotate/__about__.py +6 -0
- {annotate-2.5.0 → annotate-2.5.2}/src/annotate/__init__.py +6 -2
- {annotate-2.5.0 → annotate-2.5.2}/src/annotate/_annotate.py +4 -2
- {annotate-2.5.0 → annotate-2.5.2/src/annotate.egg-info}/PKG-INFO +10 -9
- {annotate-2.5.0 → annotate-2.5.2}/tests/__init__.py +3 -1
- {annotate-2.5.0 → annotate-2.5.2}/tests/__main__.py +3 -3
- annotate-2.5.2/tests/test_main.py +75 -0
- annotate-2.5.0/src/annotate/__about__.py +0 -4
- annotate-2.5.0/tests/test_main.py +0 -73
- {annotate-2.5.0 → annotate-2.5.2}/LICENSE +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/MANIFEST.in +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/docs/CHANGES.rst +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/docs/README.rst +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/docs/_static/.keep +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/docs/_templates/.keep +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/docs/conf.py +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/docs/index.rst +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/setup.cfg +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/src/annotate/py.typed +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/src/annotate.egg-info/SOURCES.txt +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/src/annotate.egg-info/dependency_links.txt +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/src/annotate.egg-info/requires.txt +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/src/annotate.egg-info/top_level.txt +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/src/annotate.egg-info/zip-safe +0 -0
- {annotate-2.5.0 → annotate-2.5.2}/tests/data/.keep +0 -0
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
-
2.5.
|
|
4
|
+
2.5.2 (2026-12-01)
|
|
5
|
+
------------------
|
|
6
|
+
- Added support for Python 3.16
|
|
7
|
+
- Setup updates, fixes and improvements.
|
|
8
|
+
|
|
9
|
+
2.5.1 (2026-10-15)
|
|
5
10
|
------------------
|
|
6
11
|
- Added support for GraalPy 3.13
|
|
12
|
+
- Cleanup and unification (better linting, typing etc).
|
|
7
13
|
|
|
8
14
|
2.4.5 (2026-10-03)
|
|
9
15
|
------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: annotate
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.2
|
|
4
4
|
Summary: Decorator to set a function's __annotations__ like Py3.
|
|
5
5
|
Author-email: Adam Karpierz <adam@karpierz.net>
|
|
6
6
|
Maintainer-email: Adam Karpierz <adam@karpierz.net>
|
|
@@ -25,6 +25,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.13
|
|
26
26
|
Classifier: Programming Language :: Python :: 3.14
|
|
27
27
|
Classifier: Programming Language :: Python :: 3.15
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.16
|
|
28
29
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
29
30
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
30
31
|
Classifier: Programming Language :: Python :: Implementation :: GraalPy
|
|
@@ -74,20 +75,20 @@ Examples
|
|
|
74
75
|
"""Java Array"""
|
|
75
76
|
|
|
76
77
|
@classmethod
|
|
77
|
-
@annotate(
|
|
78
|
+
@annotate("JArray", size=Union[int, long])
|
|
78
79
|
def newBooleanArray(cls, size):
|
|
79
80
|
...
|
|
80
81
|
...
|
|
81
82
|
@classmethod
|
|
82
|
-
@annotate(
|
|
83
|
+
@annotate("JArray", size=Union[int, long])
|
|
83
84
|
def newDoubleArray(cls, size):
|
|
84
85
|
...
|
|
85
86
|
@classmethod
|
|
86
|
-
@annotate(
|
|
87
|
+
@annotate("JArray", size=Union[int, long])
|
|
87
88
|
def newStringArray(cls, size):
|
|
88
89
|
...
|
|
89
90
|
@classmethod
|
|
90
|
-
@annotate(
|
|
91
|
+
@annotate("JArray", size=Union[int, long], component_class=JClass)
|
|
91
92
|
def newObjectArray(cls, size, component_class):
|
|
92
93
|
...
|
|
93
94
|
|
|
@@ -144,17 +145,17 @@ Examples
|
|
|
144
145
|
def setObject(self, idx, val):
|
|
145
146
|
...
|
|
146
147
|
|
|
147
|
-
@annotate(
|
|
148
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
148
149
|
def getBooleanSlice(self, start, stop, step):
|
|
149
150
|
...
|
|
150
151
|
...
|
|
151
|
-
@annotate(
|
|
152
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
152
153
|
def getDoubleSlice(self, start, stop, step):
|
|
153
154
|
...
|
|
154
|
-
@annotate(
|
|
155
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
155
156
|
def getStringSlice(self, start, stop, step):
|
|
156
157
|
...
|
|
157
|
-
@annotate(
|
|
158
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
158
159
|
def getObjectSlice(self, start, stop, step):
|
|
159
160
|
...
|
|
160
161
|
|
|
@@ -35,20 +35,20 @@ Examples
|
|
|
35
35
|
"""Java Array"""
|
|
36
36
|
|
|
37
37
|
@classmethod
|
|
38
|
-
@annotate(
|
|
38
|
+
@annotate("JArray", size=Union[int, long])
|
|
39
39
|
def newBooleanArray(cls, size):
|
|
40
40
|
...
|
|
41
41
|
...
|
|
42
42
|
@classmethod
|
|
43
|
-
@annotate(
|
|
43
|
+
@annotate("JArray", size=Union[int, long])
|
|
44
44
|
def newDoubleArray(cls, size):
|
|
45
45
|
...
|
|
46
46
|
@classmethod
|
|
47
|
-
@annotate(
|
|
47
|
+
@annotate("JArray", size=Union[int, long])
|
|
48
48
|
def newStringArray(cls, size):
|
|
49
49
|
...
|
|
50
50
|
@classmethod
|
|
51
|
-
@annotate(
|
|
51
|
+
@annotate("JArray", size=Union[int, long], component_class=JClass)
|
|
52
52
|
def newObjectArray(cls, size, component_class):
|
|
53
53
|
...
|
|
54
54
|
|
|
@@ -105,17 +105,17 @@ Examples
|
|
|
105
105
|
def setObject(self, idx, val):
|
|
106
106
|
...
|
|
107
107
|
|
|
108
|
-
@annotate(
|
|
108
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
109
109
|
def getBooleanSlice(self, start, stop, step):
|
|
110
110
|
...
|
|
111
111
|
...
|
|
112
|
-
@annotate(
|
|
112
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
113
113
|
def getDoubleSlice(self, start, stop, step):
|
|
114
114
|
...
|
|
115
|
-
@annotate(
|
|
115
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
116
116
|
def getStringSlice(self, start, stop, step):
|
|
117
117
|
...
|
|
118
|
-
@annotate(
|
|
118
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
119
119
|
def getObjectSlice(self, start, stop, step):
|
|
120
120
|
...
|
|
121
121
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# SPDX-License-Identifier: Zlib
|
|
3
3
|
|
|
4
4
|
# /// script
|
|
5
|
-
# dependencies = ["nox>=2026.
|
|
5
|
+
# dependencies = ["nox>=2026.10.20", "nox_ext", "nox_lib"]
|
|
6
6
|
# ///
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
@@ -69,7 +69,7 @@ def docs(session: nox.Session) -> None:
|
|
|
69
69
|
nox_lib.docs.sphinx(session)
|
|
70
70
|
|
|
71
71
|
@nox.session(python=[PY_DEFAULT], default=False,
|
|
72
|
-
requires=["tests", "docs"])
|
|
72
|
+
requires=["tests", "coverage", "lint", "typing", "docs"])
|
|
73
73
|
def build(session: nox.Session) -> None:
|
|
74
74
|
"""Building the package"""
|
|
75
75
|
session.install("--group=build")
|
|
@@ -83,14 +83,14 @@ def publish(session: nox.Session) -> None:
|
|
|
83
83
|
nox_lib.publish.on_pypi(session)
|
|
84
84
|
nox_lib.publish.docs_on_gh_pages(session)
|
|
85
85
|
|
|
86
|
-
@nox.session(python=[PY_DEFAULT])
|
|
87
|
-
def typing(session: nox.Session) -> None:
|
|
88
|
-
"""Static type checking"""
|
|
89
|
-
session.install(".", "--group=typing")
|
|
90
|
-
nox_lib.typing.mypy(session)
|
|
91
|
-
|
|
92
86
|
@nox.session(python=[PY_DEFAULT])
|
|
93
87
|
def lint(session: nox.Session) -> None:
|
|
94
88
|
"""Checking code style and quality"""
|
|
95
89
|
session.install(".", "--group=lint")
|
|
96
90
|
nox_lib.lint.flake8(session)
|
|
91
|
+
|
|
92
|
+
@nox.session(python=[PY_DEFAULT])
|
|
93
|
+
def typing(session: nox.Session) -> None:
|
|
94
|
+
"""Static type checking"""
|
|
95
|
+
session.install(".", "--group=typing")
|
|
96
|
+
nox_lib.typing.mypy(session)
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
[build-system]
|
|
5
5
|
build-backend = "setuptools.build_meta"
|
|
6
|
-
requires = [ "setuptools>=81.0.0", "packaging>=26.
|
|
6
|
+
requires = [ "setuptools>=81.0.0", "packaging>=26.4.0" ]
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "annotate"
|
|
10
|
-
version = "2.5.
|
|
10
|
+
version = "2.5.2"
|
|
11
11
|
description = "Decorator to set a function's __annotations__ like Py3."
|
|
12
12
|
keywords = [ "annotate", "typing", "decorator" ]
|
|
13
13
|
license = "Zlib"
|
|
@@ -38,6 +38,7 @@ classifiers = [
|
|
|
38
38
|
"Programming Language :: Python :: 3.13",
|
|
39
39
|
"Programming Language :: Python :: 3.14",
|
|
40
40
|
"Programming Language :: Python :: 3.15",
|
|
41
|
+
"Programming Language :: Python :: 3.16",
|
|
41
42
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
42
43
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
43
44
|
"Programming Language :: Python :: Implementation :: GraalPy",
|
|
@@ -57,7 +58,7 @@ dependencies = [
|
|
|
57
58
|
|
|
58
59
|
[dependency-groups]
|
|
59
60
|
base = [
|
|
60
|
-
"pip>=26.
|
|
61
|
+
"pip>=26.3.0; platform_python_implementation!='GraalVM'",
|
|
61
62
|
"pip>=26.1.2; platform_python_implementation=='GraalVM' and python_version~='3.13.0'",
|
|
62
63
|
"pip>=24.3.1; platform_python_implementation=='GraalVM' and python_version~='3.12.0'",
|
|
63
64
|
"setuptools>=81.0.0",
|
|
@@ -69,9 +70,9 @@ test = [
|
|
|
69
70
|
]
|
|
70
71
|
coverage = [
|
|
71
72
|
{ include-group = "test" },
|
|
72
|
-
"coverage>=7.
|
|
73
|
+
"coverage>=7.17.5",
|
|
73
74
|
"covdefaults>=2.3.0",
|
|
74
|
-
"diff-cover>=
|
|
75
|
+
"diff-cover>=11.0.5",
|
|
75
76
|
]
|
|
76
77
|
docs = [
|
|
77
78
|
{ include-group = "base" },
|
|
@@ -97,21 +98,21 @@ build = [
|
|
|
97
98
|
publish = [
|
|
98
99
|
"twine>=7.0.0",
|
|
99
100
|
]
|
|
100
|
-
typing = [
|
|
101
|
-
{ include-group = "base" },
|
|
102
|
-
"mypy>=2.4.0",
|
|
103
|
-
"mypy-extensions>=1.1.0",
|
|
104
|
-
"types-setuptools>=81.0.0.20260209",
|
|
105
|
-
]
|
|
106
101
|
lint = [
|
|
107
102
|
{ include-group = "test" },
|
|
108
|
-
"flake8>=7.
|
|
103
|
+
"flake8>=7.5.0",
|
|
109
104
|
"flake8-in-file-ignores>=0.3.0",
|
|
110
105
|
"flake8-pyproject>=1.2.4",
|
|
111
106
|
"flake8-docstrings>=1.7.0",
|
|
112
107
|
"pep8-naming>=0.15.1",
|
|
113
|
-
"flake8-builtins>=3.
|
|
114
|
-
"flake8-deprecated>=2.
|
|
108
|
+
"flake8-builtins>=3.2.0",
|
|
109
|
+
"flake8-deprecated>=2.4.0",
|
|
110
|
+
]
|
|
111
|
+
typing = [
|
|
112
|
+
{ include-group = "base" },
|
|
113
|
+
"mypy>=2.4.1",
|
|
114
|
+
"mypy-extensions>=1.2.0",
|
|
115
|
+
"types-setuptools>=81.0.0.20260209",
|
|
115
116
|
]
|
|
116
117
|
|
|
117
118
|
[tool.setuptools]
|
|
@@ -123,7 +124,7 @@ packages.find.namespaces = false
|
|
|
123
124
|
packages.find.where = [ "src" ]
|
|
124
125
|
package-dir."" = "src"
|
|
125
126
|
# package-dir."annotate.tests" = "tests"
|
|
126
|
-
package-data.annotate = [
|
|
127
|
+
package-data."annotate" = [
|
|
127
128
|
]
|
|
128
129
|
exclude-package-data."*" = [
|
|
129
130
|
"*.c", "*.h",
|
|
@@ -131,7 +132,7 @@ exclude-package-data."*" = [
|
|
|
131
132
|
"*.cxx", "*.hxx",
|
|
132
133
|
"*.pyx", "*.pxd",
|
|
133
134
|
]
|
|
134
|
-
exclude-package-data.annotate = [
|
|
135
|
+
exclude-package-data."annotate" = [
|
|
135
136
|
]
|
|
136
137
|
|
|
137
138
|
[tool.coverage]
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
# flake8-in-file-ignores: noqa: F401,F403,F821
|
|
2
|
+
|
|
1
3
|
# Copyright (c) 2012 Adam Karpierz
|
|
2
4
|
# SPDX-License-Identifier: Zlib
|
|
3
5
|
|
|
4
|
-
from
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from .__about__ import * ; del __about__ # type: ignore[name-defined]
|
|
5
9
|
|
|
6
|
-
from ._annotate import * ; del _annotate # type: ignore[name-defined]
|
|
10
|
+
from ._annotate import * ; del _annotate # type: ignore[name-defined]
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# Copyright (c) 2012 Adam Karpierz
|
|
2
2
|
# SPDX-License-Identifier: Zlib
|
|
3
3
|
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
__all__ = ("annotate",)
|
|
7
|
+
|
|
4
8
|
from typing import TypeAlias, Any
|
|
5
9
|
from collections.abc import Callable
|
|
6
10
|
|
|
7
|
-
__all__ = ('annotate',)
|
|
8
|
-
|
|
9
11
|
AnyCallable: TypeAlias = Callable[..., Any]
|
|
10
12
|
|
|
11
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: annotate
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.2
|
|
4
4
|
Summary: Decorator to set a function's __annotations__ like Py3.
|
|
5
5
|
Author-email: Adam Karpierz <adam@karpierz.net>
|
|
6
6
|
Maintainer-email: Adam Karpierz <adam@karpierz.net>
|
|
@@ -25,6 +25,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.13
|
|
26
26
|
Classifier: Programming Language :: Python :: 3.14
|
|
27
27
|
Classifier: Programming Language :: Python :: 3.15
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.16
|
|
28
29
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
29
30
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
30
31
|
Classifier: Programming Language :: Python :: Implementation :: GraalPy
|
|
@@ -74,20 +75,20 @@ Examples
|
|
|
74
75
|
"""Java Array"""
|
|
75
76
|
|
|
76
77
|
@classmethod
|
|
77
|
-
@annotate(
|
|
78
|
+
@annotate("JArray", size=Union[int, long])
|
|
78
79
|
def newBooleanArray(cls, size):
|
|
79
80
|
...
|
|
80
81
|
...
|
|
81
82
|
@classmethod
|
|
82
|
-
@annotate(
|
|
83
|
+
@annotate("JArray", size=Union[int, long])
|
|
83
84
|
def newDoubleArray(cls, size):
|
|
84
85
|
...
|
|
85
86
|
@classmethod
|
|
86
|
-
@annotate(
|
|
87
|
+
@annotate("JArray", size=Union[int, long])
|
|
87
88
|
def newStringArray(cls, size):
|
|
88
89
|
...
|
|
89
90
|
@classmethod
|
|
90
|
-
@annotate(
|
|
91
|
+
@annotate("JArray", size=Union[int, long], component_class=JClass)
|
|
91
92
|
def newObjectArray(cls, size, component_class):
|
|
92
93
|
...
|
|
93
94
|
|
|
@@ -144,17 +145,17 @@ Examples
|
|
|
144
145
|
def setObject(self, idx, val):
|
|
145
146
|
...
|
|
146
147
|
|
|
147
|
-
@annotate(
|
|
148
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
148
149
|
def getBooleanSlice(self, start, stop, step):
|
|
149
150
|
...
|
|
150
151
|
...
|
|
151
|
-
@annotate(
|
|
152
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
152
153
|
def getDoubleSlice(self, start, stop, step):
|
|
153
154
|
...
|
|
154
|
-
@annotate(
|
|
155
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
155
156
|
def getStringSlice(self, start, stop, step):
|
|
156
157
|
...
|
|
157
|
-
@annotate(
|
|
158
|
+
@annotate("JArray", start=int, stop=int, step=int)
|
|
158
159
|
def getObjectSlice(self, start, stop, step):
|
|
159
160
|
...
|
|
160
161
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
# Copyright (c)
|
|
1
|
+
# Copyright (c) 1994 Adam Karpierz
|
|
2
2
|
# SPDX-License-Identifier: Zlib
|
|
3
3
|
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
4
6
|
import unittest
|
|
5
7
|
import sys
|
|
6
8
|
import logging
|
|
7
9
|
|
|
8
10
|
from . import test_dir
|
|
9
11
|
|
|
10
|
-
log = logging.getLogger(__name__)
|
|
11
|
-
|
|
12
12
|
|
|
13
13
|
def test_suite(names=None, include=(), exclude=()):
|
|
14
14
|
from . import __name__ as pkg_name
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Copyright (c) 2012 Adam Karpierz
|
|
2
|
+
# SPDX-License-Identifier: Zlib
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import unittest
|
|
7
|
+
|
|
8
|
+
import annotate
|
|
9
|
+
from annotate import annotate
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class JArray:
|
|
13
|
+
"""Java Array"""
|
|
14
|
+
|
|
15
|
+
@classmethod
|
|
16
|
+
@annotate("JArray", size=int)
|
|
17
|
+
def newBooleanArray(cls, size):
|
|
18
|
+
...
|
|
19
|
+
|
|
20
|
+
@annotate(borrowed=bool)
|
|
21
|
+
def __init__(self, borrowed=False):
|
|
22
|
+
...
|
|
23
|
+
|
|
24
|
+
@annotate(int)
|
|
25
|
+
def getLength(self):
|
|
26
|
+
...
|
|
27
|
+
|
|
28
|
+
@annotate(bool, idx=int)
|
|
29
|
+
def getBoolean(self, idx):
|
|
30
|
+
...
|
|
31
|
+
|
|
32
|
+
@annotate(int, idx=int)
|
|
33
|
+
def getInt(self, idx, val):
|
|
34
|
+
...
|
|
35
|
+
|
|
36
|
+
@annotate(float, idx=int)
|
|
37
|
+
def getDouble(self, idx):
|
|
38
|
+
...
|
|
39
|
+
|
|
40
|
+
@annotate(str | None, idx=int)
|
|
41
|
+
def getString(self, idx):
|
|
42
|
+
...
|
|
43
|
+
|
|
44
|
+
@annotate(idx=int, val=bool)
|
|
45
|
+
def setBoolean(self, idx, val):
|
|
46
|
+
...
|
|
47
|
+
|
|
48
|
+
@annotate(idx=int, val=int)
|
|
49
|
+
def setInt(self, idx, val):
|
|
50
|
+
...
|
|
51
|
+
|
|
52
|
+
@annotate(idx=int, val=float)
|
|
53
|
+
def setDouble(self, idx, val):
|
|
54
|
+
...
|
|
55
|
+
|
|
56
|
+
@annotate(idx=int, val=str | None)
|
|
57
|
+
def setString(self, idx, val):
|
|
58
|
+
...
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class MainTestCase(unittest.TestCase):
|
|
62
|
+
|
|
63
|
+
def test_main(self):
|
|
64
|
+
self.assertEqual(JArray.newBooleanArray.__annotations__,
|
|
65
|
+
{"size": int, "return": "JArray"})
|
|
66
|
+
self.assertEqual(JArray.__init__.__annotations__, {"borrowed": bool})
|
|
67
|
+
self.assertEqual(JArray.getLength.__annotations__, {"return": int})
|
|
68
|
+
self.assertEqual(JArray.getBoolean.__annotations__, {"idx": int, "return": bool})
|
|
69
|
+
self.assertEqual(JArray.getInt.__annotations__, {"idx": int, "return": int})
|
|
70
|
+
self.assertEqual(JArray.getDouble.__annotations__, {"idx": int, "return": float})
|
|
71
|
+
self.assertEqual(JArray.getString.__annotations__, {"idx": int, "return": str | None})
|
|
72
|
+
self.assertEqual(JArray.setBoolean.__annotations__, {"idx": int, "val": bool})
|
|
73
|
+
self.assertEqual(JArray.setInt.__annotations__, {"idx": int, "val": int})
|
|
74
|
+
self.assertEqual(JArray.setDouble.__annotations__, {"idx": int, "val": float})
|
|
75
|
+
self.assertEqual(JArray.setString.__annotations__, {"idx": int, "val": str | None})
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2012 Adam Karpierz
|
|
2
|
-
# SPDX-License-Identifier: Zlib
|
|
3
|
-
|
|
4
|
-
import unittest
|
|
5
|
-
from typing import Optional, Union
|
|
6
|
-
|
|
7
|
-
import annotate
|
|
8
|
-
from annotate import annotate
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class JArray:
|
|
12
|
-
"""Java Array"""
|
|
13
|
-
|
|
14
|
-
@classmethod
|
|
15
|
-
@annotate('JArray', size=int)
|
|
16
|
-
def newBooleanArray(cls, size):
|
|
17
|
-
...
|
|
18
|
-
|
|
19
|
-
@annotate(borrowed=bool)
|
|
20
|
-
def __init__(self, borrowed=False):
|
|
21
|
-
...
|
|
22
|
-
|
|
23
|
-
@annotate(int)
|
|
24
|
-
def getLength(self):
|
|
25
|
-
...
|
|
26
|
-
|
|
27
|
-
@annotate(bool, idx=int)
|
|
28
|
-
def getBoolean(self, idx):
|
|
29
|
-
...
|
|
30
|
-
|
|
31
|
-
@annotate(int, idx=int)
|
|
32
|
-
def getInt(self, idx, val):
|
|
33
|
-
...
|
|
34
|
-
|
|
35
|
-
@annotate(float, idx=int)
|
|
36
|
-
def getDouble(self, idx):
|
|
37
|
-
...
|
|
38
|
-
|
|
39
|
-
@annotate(Optional[str], idx=int)
|
|
40
|
-
def getString(self, idx):
|
|
41
|
-
...
|
|
42
|
-
|
|
43
|
-
@annotate(idx=int, val=bool)
|
|
44
|
-
def setBoolean(self, idx, val):
|
|
45
|
-
...
|
|
46
|
-
|
|
47
|
-
@annotate(idx=int, val=int)
|
|
48
|
-
def setInt(self, idx, val):
|
|
49
|
-
...
|
|
50
|
-
|
|
51
|
-
@annotate(idx=int, val=float)
|
|
52
|
-
def setDouble(self, idx, val):
|
|
53
|
-
...
|
|
54
|
-
|
|
55
|
-
@annotate(idx=int, val=Optional[str])
|
|
56
|
-
def setString(self, idx, val):
|
|
57
|
-
...
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class MainTestCase(unittest.TestCase):
|
|
61
|
-
|
|
62
|
-
def test_main(self):
|
|
63
|
-
self.assertEqual(JArray.newBooleanArray.__annotations__, {"size": int, "return": "JArray"})
|
|
64
|
-
self.assertEqual(JArray.__init__.__annotations__, {"borrowed": bool})
|
|
65
|
-
self.assertEqual(JArray.getLength.__annotations__, {"return": int})
|
|
66
|
-
self.assertEqual(JArray.getBoolean.__annotations__, {"idx": int, "return": bool})
|
|
67
|
-
self.assertEqual(JArray.getInt.__annotations__, {"idx": int, "return": int})
|
|
68
|
-
self.assertEqual(JArray.getDouble.__annotations__, {"idx": int, "return": float})
|
|
69
|
-
self.assertEqual(JArray.getString.__annotations__, {"idx": int, "return": Optional[str]})
|
|
70
|
-
self.assertEqual(JArray.setBoolean.__annotations__, {"idx": int, "val": bool})
|
|
71
|
-
self.assertEqual(JArray.setInt.__annotations__, {"idx": int, "val": int})
|
|
72
|
-
self.assertEqual(JArray.setDouble.__annotations__, {"idx": int, "val": float})
|
|
73
|
-
self.assertEqual(JArray.setString.__annotations__, {"idx": int, "val": Optional[str]})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|