cell type definition character for null and numeric are the same

Issue #664 wontfix
Alf
created an issue

At least until v1.8.x the cell type definition character for numeric and empty was different (setting it to TYPE_NULL = 's' was also not good). But now it is the same:

TYPE_NUMERIC = 'n'
TYPE_NULL = 'n'

This gives problems or leads to more complicated code when checking if a cell has numeric data or not.

I sugggest to change this to an unsused char like "0". This change would require only a few further changes in the code in cell class like

self.data_type = 'n' -> self.data_type = self.TYPE_NULL or self.data_type == self.TYPE_NUMERIC

at the corresponding lines.

In addition, instead of

elif isinstance(value, NUMERIC_TYPES): pass

it should be

elif isinstance(value, NUMERIC_TYPES): self.data_type = self.TYPE_NUMERIC

since it gives sometime the wrong cell type.

Comments (1)

  1. Log in to comment