Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of type conversion #29

Closed
GoogleCodeExporter opened this issue Dec 6, 2015 · 2 comments
Closed

Lack of type conversion #29

GoogleCodeExporter opened this issue Dec 6, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. try to make a 'guess number' sample with issue 24 read/input block

the sample is :


number = 23
guess = int(raw_input('Enter an integer : '))
if guess == number:
    print 'Congratulations, you guessed it.' # New block starts here
    print '(but you do not win any prizes!)' # New block ends here
elif guess < number:
    print 'No, it is higher than that.' # Another block
    # You can do whatever you want in a block ...
else:
    print 'No, it is lower than that.'
    # you must have guess > number to reach this block
print 'Done'


What is the expected output? What do you see instead?

It works fine in javascript, but not for python output, since the generated 
python code lack of 'int' to do the type conversion.

one way is to provide additional TYPE info while get user input, thus we'll 
have one block.
another way is to provide a set of type conversion blocks, which might be break 
the 'no need to learn formats' rule.

Original issue reported on code.google.com by gasolin on 12 Jun 2012 at 12:21

@GoogleCodeExporter
Copy link
Author

I would like a type selector for the input field. Then mobile browsers could 
open the correct input mask for different types of input. (number field for 
numbers, visual keyboard for text)
An other benefit would be automatic input checking.

Original comment by markus.k...@gmail.com on 15 Jun 2012 at 2:15

@GoogleCodeExporter
Copy link
Author

It might be good to implement type conversion in every input blocks.

Thus this issue will be merged to Issue 24

Original comment by gasolin on 16 Jun 2012 at 8:06

  • Changed state: Duplicate
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant