vyperlang/vyper

Improve error message for `math` namespace collision

オープン

#4,579 opened on 2025/04/14

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Python (849 件のフォーク)batch import
Easy Pickingsbug - UXhelp wanted

Repository metrics

Stars
 (4,710 個のスター)
PR merge metrics
 (平均マージ 10d 21h) (30d で 34 merged PRs)

説明

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.

コントリビューターガイド