Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f94b6d commit d7fed37Copy full SHA for d7fed37
1 file changed
Lib/json/decoder.py
@@ -1,9 +1,6 @@
1
"""Implementation of JSONDecoder
2
"""
3
-import binascii
4
import re
5
-import sys
6
-import struct
7
8
from json import scanner
9
try:
@@ -15,14 +12,9 @@
15
12
16
13
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
17
14
18
-def _floatconstants():
19
- _BYTES = binascii.unhexlify(b'7FF80000000000007FF0000000000000')
20
- if sys.byteorder != 'big':
21
- _BYTES = _BYTES[:8][::-1] + _BYTES[8:][::-1]
22
- nan, inf = struct.unpack('dd', _BYTES)
23
- return nan, inf, -inf
24
-
25
-NaN, PosInf, NegInf = _floatconstants()
+NaN = float('nan')
+PosInf = float('inf')
+NegInf = float('-inf')
26
27
28
def linecol(doc, pos):
0 commit comments