Skip to content

Python 3 memoryview : unsupported format <d #13617

@evanmason

Description

@evanmason

In moving some code from Python 2 to Python 3 I've run into a problem with memoryview. The code below works with Python 2, but not Python 3. Is there a workaround for this?

Reproducing code example:

import numpy as np
from multiprocessing import sharedctypes

x = sharedctypes.RawArray('d', 10)
memoryview(x)[:] = array(np.zeros_like(np.arange(10.), dtype=float64))

Error message:

NotImplementedError: memoryview: unsupported format <d

Numpy/Python version information:

Python 3.5.7 + numpy '1.16.3' and Python 2.7.15 + numpy '1.16.0'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions