spylang/spy

Track deviations from CPython semantics

Aberta

#601 aberto em 24 de jun. de 2026

 (0 comentário) (0 reação) (0 responsável)Python (60 forks)auto 404
good first issuehelp wanted

Métricas do repositório

Stars
 (803 estrelas)
Métricas de merge de PR
 (Mesclagem média 11d 20h) (22 fundiu PRs em 30d)

Description

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.

Guia do colaborador