-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy path__init__.py
More file actions
46 lines (35 loc) · 867 Bytes
/
__init__.py
File metadata and controls
46 lines (35 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of ObjectPath released under MIT license.
# Copyright (C) 2010-2014 Adrian Kalbarczyk
from types import GeneratorType as generator
from itertools import chain
from sys import version_info
SELECTOR_OPS = [
"is", ">", "<", "is not", ">=", "<=", "in", "not in", ":", "and", "or", "matches", "fn"
]
# it must be list because of further concatenations
NUM_TYPES = [int, float]
try:
NUM_TYPES += [long]
except NameError:
pass
STR_TYPES = [str]
try:
STR_TYPES += [unicode]
except NameError:
pass
ITER_TYPES = [list, generator, chain]
if version_info[0] >= 3:
ITER_TYPES += [map, filter]
class ProgrammingError(Exception):
pass
class ExecutionError(Exception):
pass
PY_TYPES_MAP = {
"int": "number",
"float": "number",
"str": "string",
"dict": "object",
"list": "array"
}