Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
move _dtype initialisation to class definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ARF committed May 6, 2015
1 parent 883f196 commit eaf42a1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bcolz/ctable.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def cparams(self):
"The compression parameters for this object."
return self._cparams

self._dtype = None
@property
def dtype(self):
"The data type of this object (numpy dtype)."
Expand Down Expand Up @@ -226,8 +227,6 @@ def __init__(self, columns=None, names=None, **kwargs):
# Attach the attrs to this object
self.attrs = attrs.attrs(self.rootdir, self.mode, _new=_new)

# Trigger update of dtype cache
self._dtype = None
# Cache a structured array of len 1 for ctable[int] acceleration
self._arr1 = np.empty(shape=(1,), dtype=self.dtype)

Expand Down

0 comments on commit eaf42a1

Please sign in to comment.