Page MenuHomePhabricator

dot product code implementations fail
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
The code implementations fail.

What should have happened instead?:
They should pass.

It can easily be that the error is in the code implementations. Users Dv13 and 99of9 couldn't figure out what's wrong. This needs investigation. Reported here: https://www.wikifunctions.org/wiki/Wikifunctions:Project_chat#Problems_with_a_js_implementation

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

The javascript implementations now seem to work. The python doesn't.

The problem was the import statement:

import fractions.Fraction as f

doesn't work because fractions isn't a package. The correct invocation is

from fractions import Fraction as f

I've tested this under python3.12 and RustPython. I've also changed the live implementation and tests are passing.

Nice, thanks. Looks done to me.

Thanks! This looks resolved.