mirror of
https://github.com/python/cpython.git
synced 2025-10-12 09:53:19 +00:00
Obvious simplification, now that "long" has disappeared.
This commit is contained in:
parent
ae0b088f6c
commit
a4618736c0
1 changed files with 1 additions and 5 deletions
|
@ -369,7 +369,7 @@ class Sniffer:
|
||||||
|
|
||||||
for col in list(columnTypes.keys()):
|
for col in list(columnTypes.keys()):
|
||||||
|
|
||||||
for thisType in [int, int, float, complex]:
|
for thisType in [int, float, complex]:
|
||||||
try:
|
try:
|
||||||
thisType(row[col])
|
thisType(row[col])
|
||||||
break
|
break
|
||||||
|
@ -379,10 +379,6 @@ class Sniffer:
|
||||||
# fallback to length of string
|
# fallback to length of string
|
||||||
thisType = len(row[col])
|
thisType = len(row[col])
|
||||||
|
|
||||||
# treat longs as ints
|
|
||||||
if thisType == int:
|
|
||||||
thisType = int
|
|
||||||
|
|
||||||
if thisType != columnTypes[col]:
|
if thisType != columnTypes[col]:
|
||||||
if columnTypes[col] is None: # add new column type
|
if columnTypes[col] is None: # add new column type
|
||||||
columnTypes[col] = thisType
|
columnTypes[col] = thisType
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue