Skip to content

Commit baa3363

Browse files
committed
TESTS PASSED ! YAY !
1 parent e8fa07d commit baa3363

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

pandas/_libs/lib.pyx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ from cpython.datetime cimport (PyDateTime_Check, PyDate_Check,
1515
PyDateTime_IMPORT)
1616
PyDateTime_IMPORT
1717

18+
from fractions import Fraction
19+
from numbers import Number
1820

1921
import numpy as np
2022
cimport numpy as cnp
@@ -153,8 +155,8 @@ def is_scalar(val: object) -> bint:
153155
or is_decimal(val)
154156
or is_interval(val)
155157
or util.is_offset_object(val)
156-
or isinstance(val,Number)
157-
or ininstance(val,Fraction))
158+
or isinstance(val, Number)
159+
or isinstance(val, Fraction))
158160

159161
def item_from_zerodim(val: object) -> object:
160162
"""

pandas/tests/dtypes/test_inference.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
import numpy as np
1414
import pytz
1515
import pytest
16-
16+
from numbers import Number
17+
from fractions import Fraction
1718
import pandas as pd
1819
from pandas._libs import tslib, lib, missing as libmissing
1920
from pandas import (Series, Index, DataFrame, Timedelta,
@@ -1183,6 +1184,10 @@ def test_is_scalar_pandas_containers(self):
11831184
assert not is_scalar(Panel([[[1]]]))
11841185
assert not is_scalar(Index([]))
11851186
assert not is_scalar(Index([1]))
1187+
1188+
def tes_is_scalar_pep_3141(self):
1189+
assert is_scalar(Number())
1190+
assert is_scalar(Fraction())
11861191

11871192

11881193
def test_datetimeindex_from_empty_datetime64_array():

0 commit comments

Comments
 (0)