Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implement type numpy.ndarray #2091

Open
@rebcabin

Description

@rebcabin

Here is some code that works in CPython but not in LPython:

from numpy import (empty, sqrt, float32, float64,
                   int8, int32, array, ndarray)


BITS_PER_BYTE : ndarray(16, dtype=int32) = \
    array([ 0,  1,  1,  2,
            1,  2,  2,  3,
            1,  2,  2,  3,
            2,  3,  3,  4])
(lp) ┌─(~/CLionProjects/lpython/lasr/LP-pycharm)─────────────────────────────────────────────────────────────────────────────────────────────────────────(brian@Golf37:s000)─┐
└─(14:45:05 on brian-lasr ✹)──> PYTHONPATH='../../src/runtime/lpython' python issue2090.py                                                            2 ↵ ──(Mon,Jul03)─┘
(lp) ┌─(~/CLionProjects/lpython/lasr/LP-pycharm)─────────────────────────────────────────────────────────────────────────────────────────────────────────(brian@Golf37:s000)─┐
└─(14:45:13 on brian-lasr ✹)──> ~/CLionProjects/lpython/src/bin/lpython -I. issue2090.py                                                                  ──(Mon,Jul03)─┘
semantic error: The symbol 'ndarray' not found in the module 'numpy'
 --> issue2090.py:2:40
  |
2 |                    int8, int32, array, ndarray)
  |                                        ^^^^^^^ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions