vyperlang/vyper

Improve error message for `math` namespace collision

Open

#4,579 创建于 2025年4月14日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Python (849 fork)batch import
Easy Pickingsbug - UXhelp wanted

仓库指标

Star
 (4,710 star)
PR 合并指标
 (平均合并 10天 21小时) (30 天内合并 34 个 PR)

描述

The following snippet will throw with

from snekmate.utils import math
import math
vyper.exceptions.NamespaceCollision: 'math' has already been declared as a ModuleInfo(module_t=venv/Lib/site-packages/snekmate/utils/math.vy, alias='math', ownership=<ModuleOwnership.NO_OWNERSHIP: 'no_ownership'>, ownership_decl=None)

  contract "test.vy:2", line 2:0
       1 from snekmate.utils import math
  ---> 2 import math
  -------^
       3

You must run it via vyper test.vy --enable-decimals.

贡献者指南