Skip to content

Custom constants of lists #1211

@nrryuya

Description

@nrryuya

Version Information

  • vyper Version: 0.1.0 beta 7

What's your issue about?

I'm not sure whether this is designed or a bug but Vyper doesn't support custom constants of lists.
It'd be better to support it if there is no concern?

# Invalid value for constant type, expected bytes[8] got bytes[8] instead
BYTE_LIST: constant(bytes[8]) = 'abcdefgh'

# 'ListType' object has no attribute 'is_literal'
BYTE32_LIST: constant(bytes32[2]) = [0x0000000000000000000000000000000000000000000000000000000000000000,
                                    0x0000000000000000000000000000000000000000000000000000000000000000]

# 'ListType' object has no attribute 'is_literal'
ZERO_LIST: constant(int128[8]) = [0, 0, 0, 0, 0, 0, 0, 0]

# 'ListType' object has no attribute 'is_literal'
ZERO_LIST: constant(uint256[8]) = [convert(0, uint256), convert(0, uint256), convert(0, uint256), convert(0, uint256), convert(0, uint256), convert(0, uint256), convert(0, uint256), convert(0, uint256)]

Cute Animal Picture

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    VIP: ApprovedVIP ApprovedVIP: DiscussionUsed to denote VIPs and more complex issues that are waiting discussion in a meeting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions