Skip to content

Commit 3dc1faf

Browse files
authored
Добавлена поддержка Decimal(double) (#6)
1 parent 82fabc6 commit 3dc1faf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mmdb_writer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import struct
77
import time
88
from typing import Union
9+
from decimal import Decimal
910

1011
from netaddr import IPSet, IPNetwork
1112

@@ -205,6 +206,8 @@ def python_type_id(self, value):
205206
return 8
206207
else:
207208
return 5
209+
if value_type is Decimal:
210+
return 3
208211
raise TypeError("unknown type {value_type}".format(value_type=value_type))
209212

210213
def encode_meta(self, meta):

0 commit comments

Comments
 (0)