Minor "Bug" using the autocompleter

Well long story short, the autocompleter suggests a string.
However both textboxes are set as type number.

Nothing major, but still maybe usefull for you guys.

This is from TextBox.js inside the anvil-runtime:

It looks as if the data is still stored in a string type in the .text property, only returning a number when called.
It is very possible that
image

does nothing in skulpt other than reassign pointer values to a .text property, until some kind of operation is actually done, at which time the string value is turned into a number or None if it is blank, since the html should only allow those two states to exist in the “string”.
(If you assigned the ‘number’ type)

TLDR: It looks like some other method for turning strings into numbers was used, and the value shown in the autocompleter is based on a docstring, and not python type hints with more than one possible return value for the .text property. (…Not sure where skulpt even is regarding type hints)

Type hinting the return value should override the implicit return value. (Recent update)

1 Like

@stucork awesome news - love that.

1 Like