spylang/spy

Track deviations from CPython semantics

オープン

#601 opened on 2026/06/24

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Python (60 件のフォーク)auto 404
good first issuehelp wanted

Repository metrics

Stars
 (803 個のスター)
PR merge metrics
 (PR metrics pending)

説明

As more Python users start using Spy, we will likely encounter deviations from expected CPython semantics. We should track and document those differences as they are identified.

The initial discussion started here. As noted in that PR, Spy currently differs from Python in the behavior of the power operator.

Python:

  • For int operands, the result is a float if the exponent is negative.
  • A negative base with a fractional exponent returns a complex number, e.g. (-5) ** 0.5 == (1.3691967456605067e-16+2.23606797749979j).

Spy:

  • A negative exponent instead raises ValueError.
  • A negative base with a fractional exponent also raises ValueError.

@JeffersGlass raised another semantic difference here, this time involving the in operator.

This issue can serve as a place to collect and document these CPython/SPy semantic differences as they are discovered.

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