koatl 0.1.41__tar.gz → 0.1.42__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.
- {koatl-0.1.41 → koatl-0.1.42}/Cargo.lock +1 -1
- {koatl-0.1.41 → koatl-0.1.42}/PKG-INFO +1 -1
- {koatl-0.1.41 → koatl-0.1.42}/koatl/Cargo.toml +1 -1
- {koatl-0.1.41 → koatl-0.1.42/koatl}/python/koatl/runtime/__init__.py +4 -3
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/runtime/meta_finder.py +1 -1
- koatl-0.1.42/koatl/python/koatl/std/io.tl +7 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/iter.tl +4 -0
- koatl-0.1.42/koatl/python/koatl/std/json.tl +34 -0
- koatl-0.1.42/koatl/python/koatl/std/pickle.tl +10 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/trait.py +2 -2
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/transform.rs +1 -1
- {koatl-0.1.41/koatl → koatl-0.1.42}/python/koatl/runtime/__init__.py +4 -3
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/runtime/meta_finder.py +1 -1
- koatl-0.1.42/python/koatl/std/io.tl +7 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/iter.tl +4 -0
- koatl-0.1.42/python/koatl/std/json.tl +34 -0
- koatl-0.1.42/python/koatl/std/pickle.tl +10 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/trait.py +2 -2
- koatl-0.1.41/koatl/python/koatl/std/io.tl +0 -3
- koatl-0.1.41/python/koatl/std/io.tl +0 -3
- {koatl-0.1.41 → koatl-0.1.42}/Cargo.toml +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/README.md +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/.github/workflows/CI.yml +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/.gitignore +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/LICENSE +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/README.md +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/__init__.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/__main__.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/cli.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/notebook/__init__.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/notebook/magic.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/prelude/__init__.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/runtime/record.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/runtime/vattr.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/alg/__init__.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/alg/async.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/alg/base.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/alg/do.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/alg/env.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/alg/memo.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/alg/result.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/data/__init__.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/data/list.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/data/record.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/ext.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/lazy_module.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/python/koatl/std/re.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/requirements.txt +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/src/emit_py.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/src/lib.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/containers.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/data.txt +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/decorators.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/destructure-for-and-fn.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/destructure.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/escape_ident.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/fstr.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/functions.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/generator.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/if_expr.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/loops.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/match.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/nary-list.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/placeholder.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/precedence.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/scopes.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/semantic_whitespace.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/short_circuit.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/base/with.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/async.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/aug_assign.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/coal.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/env.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/imports.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/iterables.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/list.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/memo.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/record.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/result.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/slice.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/try.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/prelude/virtual.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/util/__init__.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/util/module0.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/util/module1.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/e2e/util/module2.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/parse/arith.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/parse/assign.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/parse/block-comments.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/parse/deco.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/parse/func.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/parse/matches.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/test_e2e.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl/tests/test_parse.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/Cargo.toml +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/parser/Cargo.toml +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/parser/src/ast.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/parser/src/lexer.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/parser/src/lib.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/parser/src/parser.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/parser/src/util.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/inference.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/lib.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/main.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/parse_timer.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/parser.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/py/ast.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/py/emit.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/py/mod.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/py/util.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/resolve_scopes.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/types.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/koatl-core/src/util.rs +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/pyproject.toml +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/__init__.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/__main__.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/cli.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/notebook/__init__.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/notebook/magic.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/prelude/__init__.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/runtime/record.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/runtime/vattr.py +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/alg/__init__.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/alg/async.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/alg/base.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/alg/do.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/alg/env.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/alg/memo.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/alg/result.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/data/__init__.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/data/list.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/data/record.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/ext.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/lazy_module.tl +0 -0
- {koatl-0.1.41 → koatl-0.1.42}/python/koatl/std/re.tl +0 -0
|
@@ -3,7 +3,8 @@ import importlib
|
|
|
3
3
|
from types import SimpleNamespace
|
|
4
4
|
|
|
5
5
|
from koatl.runtime.record import Record
|
|
6
|
-
from . import meta_finder
|
|
6
|
+
from . import meta_finder
|
|
7
|
+
from .vattr import vhas, vget
|
|
7
8
|
|
|
8
9
|
meta_finder.install_hook()
|
|
9
10
|
|
|
@@ -42,6 +43,6 @@ __tl__ = SimpleNamespace(
|
|
|
42
43
|
#
|
|
43
44
|
set_exports=set_exports,
|
|
44
45
|
#
|
|
45
|
-
vget=
|
|
46
|
-
vhas=
|
|
46
|
+
vget=vget,
|
|
47
|
+
vhas=vhas,
|
|
47
48
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import itertools
|
|
2
2
|
import builtins
|
|
3
3
|
|
|
4
|
+
import koatl.std.data.Record
|
|
4
5
|
import koatl.std.trait.Trait
|
|
5
6
|
import .alg.(Traversable, Ok, Err, Memo, Async, AsyncMemo, Result)
|
|
6
7
|
|
|
@@ -52,6 +53,9 @@ export Iterable = class(Traversable, Trait):
|
|
|
52
53
|
chain = (self, *others) =>
|
|
53
54
|
itertools.chain(self.iter, *others.map($.iter))
|
|
54
55
|
|
|
56
|
+
product = (self, *others) =>
|
|
57
|
+
itertools.product(self.iter, *others.map($.iter))
|
|
58
|
+
|
|
55
59
|
zip = (self, *others) =>
|
|
56
60
|
zip(self.iter, *others.map($.iter))
|
|
57
61
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import koatl.std.io
|
|
3
|
+
import koatl.std.data.Record
|
|
4
|
+
|
|
5
|
+
export JSONEncoder = class(json.JSONEncoder):
|
|
6
|
+
default = (self, o) =>
|
|
7
|
+
o match:
|
|
8
|
+
Record() => o.__dict__
|
|
9
|
+
default => super().default(o)
|
|
10
|
+
|
|
11
|
+
export JSONDecoder = class(json.JSONDecoder):
|
|
12
|
+
__init__ = (self, **kwargs) =>
|
|
13
|
+
let object_hook = d =>
|
|
14
|
+
d match:
|
|
15
|
+
dict() => Record(d)
|
|
16
|
+
default => d
|
|
17
|
+
|
|
18
|
+
super().__init__(object_hook=object_hook, **kwargs)
|
|
19
|
+
|
|
20
|
+
export parse = json_str => JSONDecoder().decode(json_str)
|
|
21
|
+
|
|
22
|
+
export stringify = (obj, **kwargs) => JSONEncoder(**kwargs).encode(obj)
|
|
23
|
+
|
|
24
|
+
export pretty = obj => stringify(obj, indent=2)
|
|
25
|
+
|
|
26
|
+
export compact = obj => stringify(obj, separators=(",", ":"))
|
|
27
|
+
|
|
28
|
+
export read_file = filename =>
|
|
29
|
+
let s = io.read_file(filename)
|
|
30
|
+
parse(s)
|
|
31
|
+
|
|
32
|
+
export write_file = (filename, obj, indent=2, sort_keys=True) =>
|
|
33
|
+
let s = stringify(obj, indent=indent, sort_keys=sort_keys)
|
|
34
|
+
io.write_file(filename, s)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import pickle
|
|
2
|
+
import koatl.std.io
|
|
3
|
+
|
|
4
|
+
export write_file = (filename, obj, protocol=None) =>
|
|
5
|
+
with f = open(filename, "wb"):
|
|
6
|
+
pickle.dump(obj, f, protocol=protocol ?? pickle.DEFAULT_PROTOCOL)
|
|
7
|
+
|
|
8
|
+
export load_file = filename =>
|
|
9
|
+
with f = open(filename, "rb"):
|
|
10
|
+
pickle.load(f)
|
|
@@ -2,7 +2,7 @@ import abc
|
|
|
2
2
|
import collections
|
|
3
3
|
import inspect
|
|
4
4
|
|
|
5
|
-
from koatl.
|
|
5
|
+
from koatl.runtime import vhas
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@collections.abc.Mapping.register
|
|
@@ -90,7 +90,7 @@ class TraitMeta(MappingMeta):
|
|
|
90
90
|
# Check if the exact class has _trait_reqs, in which case it's a trait.
|
|
91
91
|
if "_trait_reqs" in cls.__dict__:
|
|
92
92
|
for req in cls._trait_reqs:
|
|
93
|
-
if not
|
|
93
|
+
if not vhas(instance, req):
|
|
94
94
|
return False
|
|
95
95
|
|
|
96
96
|
return True
|
|
@@ -719,7 +719,7 @@ fn create_throwing_matcher<'src, 'ast>(
|
|
|
719
719
|
let a = PyAstBuilder::new(pattern.span);
|
|
720
720
|
let success = PyBlock(vec![a.pass()]);
|
|
721
721
|
let fail = PyBlock(vec![a.raise(Some(a.call(
|
|
722
|
-
a.
|
|
722
|
+
a.tl_builtin("MatchError"),
|
|
723
723
|
vec![a.call_arg(a.fstr(vec![
|
|
724
724
|
a.fstr_str("failed to match value of type "),
|
|
725
725
|
a.fstr_expr(
|
|
@@ -3,7 +3,8 @@ import importlib
|
|
|
3
3
|
from types import SimpleNamespace
|
|
4
4
|
|
|
5
5
|
from koatl.runtime.record import Record
|
|
6
|
-
from . import meta_finder
|
|
6
|
+
from . import meta_finder
|
|
7
|
+
from .vattr import vhas, vget
|
|
7
8
|
|
|
8
9
|
meta_finder.install_hook()
|
|
9
10
|
|
|
@@ -42,6 +43,6 @@ __tl__ = SimpleNamespace(
|
|
|
42
43
|
#
|
|
43
44
|
set_exports=set_exports,
|
|
44
45
|
#
|
|
45
|
-
vget=
|
|
46
|
-
vhas=
|
|
46
|
+
vget=vget,
|
|
47
|
+
vhas=vhas,
|
|
47
48
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import itertools
|
|
2
2
|
import builtins
|
|
3
3
|
|
|
4
|
+
import koatl.std.data.Record
|
|
4
5
|
import koatl.std.trait.Trait
|
|
5
6
|
import .alg.(Traversable, Ok, Err, Memo, Async, AsyncMemo, Result)
|
|
6
7
|
|
|
@@ -52,6 +53,9 @@ export Iterable = class(Traversable, Trait):
|
|
|
52
53
|
chain = (self, *others) =>
|
|
53
54
|
itertools.chain(self.iter, *others.map($.iter))
|
|
54
55
|
|
|
56
|
+
product = (self, *others) =>
|
|
57
|
+
itertools.product(self.iter, *others.map($.iter))
|
|
58
|
+
|
|
55
59
|
zip = (self, *others) =>
|
|
56
60
|
zip(self.iter, *others.map($.iter))
|
|
57
61
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import koatl.std.io
|
|
3
|
+
import koatl.std.data.Record
|
|
4
|
+
|
|
5
|
+
export JSONEncoder = class(json.JSONEncoder):
|
|
6
|
+
default = (self, o) =>
|
|
7
|
+
o match:
|
|
8
|
+
Record() => o.__dict__
|
|
9
|
+
default => super().default(o)
|
|
10
|
+
|
|
11
|
+
export JSONDecoder = class(json.JSONDecoder):
|
|
12
|
+
__init__ = (self, **kwargs) =>
|
|
13
|
+
let object_hook = d =>
|
|
14
|
+
d match:
|
|
15
|
+
dict() => Record(d)
|
|
16
|
+
default => d
|
|
17
|
+
|
|
18
|
+
super().__init__(object_hook=object_hook, **kwargs)
|
|
19
|
+
|
|
20
|
+
export parse = json_str => JSONDecoder().decode(json_str)
|
|
21
|
+
|
|
22
|
+
export stringify = (obj, **kwargs) => JSONEncoder(**kwargs).encode(obj)
|
|
23
|
+
|
|
24
|
+
export pretty = obj => stringify(obj, indent=2)
|
|
25
|
+
|
|
26
|
+
export compact = obj => stringify(obj, separators=(",", ":"))
|
|
27
|
+
|
|
28
|
+
export read_file = filename =>
|
|
29
|
+
let s = io.read_file(filename)
|
|
30
|
+
parse(s)
|
|
31
|
+
|
|
32
|
+
export write_file = (filename, obj, indent=2, sort_keys=True) =>
|
|
33
|
+
let s = stringify(obj, indent=indent, sort_keys=sort_keys)
|
|
34
|
+
io.write_file(filename, s)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import pickle
|
|
2
|
+
import koatl.std.io
|
|
3
|
+
|
|
4
|
+
export write_file = (filename, obj, protocol=None) =>
|
|
5
|
+
with f = open(filename, "wb"):
|
|
6
|
+
pickle.dump(obj, f, protocol=protocol ?? pickle.DEFAULT_PROTOCOL)
|
|
7
|
+
|
|
8
|
+
export load_file = filename =>
|
|
9
|
+
with f = open(filename, "rb"):
|
|
10
|
+
pickle.load(f)
|
|
@@ -2,7 +2,7 @@ import abc
|
|
|
2
2
|
import collections
|
|
3
3
|
import inspect
|
|
4
4
|
|
|
5
|
-
from koatl.
|
|
5
|
+
from koatl.runtime import vhas
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@collections.abc.Mapping.register
|
|
@@ -90,7 +90,7 @@ class TraitMeta(MappingMeta):
|
|
|
90
90
|
# Check if the exact class has _trait_reqs, in which case it's a trait.
|
|
91
91
|
if "_trait_reqs" in cls.__dict__:
|
|
92
92
|
for req in cls._trait_reqs:
|
|
93
|
-
if not
|
|
93
|
+
if not vhas(instance, req):
|
|
94
94
|
return False
|
|
95
95
|
|
|
96
96
|
return True
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|