コード例 #1
0
    def __setitem__(self, key, value):
        theKey = rands(10)
        filePath = self.dirPath + '/' + theKey

        self._paths[key] = filePath

        if isinstance(value, Picklable):
            value.save(filePath)
        else:
            f = open(filePath, 'w')
            try:
                cPickle.dump(value, f)
            finally:
                f.close()

        self._paths[key] = filePath
        self._classes[key] = value.__class__
コード例 #2
0
ファイル: collection.py プロジェクト: choketsu/pandas
    def __setitem__(self, key, value):
        theKey = rands(10)
        filePath = self.dirPath + '/' + theKey

        self._paths[key] = filePath

        if isinstance(value, Picklable):
            value.save(filePath)
        else:
            f = open(filePath, 'w')
            try:
                cPickle.dump(value, f)
            finally:
                f.close()

        self._paths[key] = filePath
        self._classes[key] = value.__class__
コード例 #3
0
ファイル: test_pytools.py プロジェクト: choketsu/pandas
def test_rands():
    r = pytools.rands(10)
    assert(len(r) == 10)
コード例 #4
0
ファイル: test_pytools.py プロジェクト: willgrass/pandas
def test_rands():
    r = pytools.rands(10)
    assert (len(r) == 10)