Comment #16 on issue 166 by vinetouu: The cursor should be put on current window when switch between windows by Ctrl+Tab
http://code.google.com/p/ulipad/issues/detail?id=166

Limodou, I must tell you something. The keyword 'is' checks if two objects are of the same type, and the '==' sign checks if an object has the specified value after the
'==' sign.

Try it in the interpreter:
1 is True
False

You are testing here if the type 'int' is the same object as the type 'bool', and you
get the response that it is not.

type(1)
<type 'int'>
type(True)
<type 'bool'>

You can see that those two objects are of different type. The keyword 'is' checks if two objects are the same type. If you want to test the value of one object, then use
the '==' sign.


1 == True
True

Here you check what the boolean *value* (True or False) of the integer type is. By
default, everything in Python is True except 0, None, False, [], '', {} ...


In the method on_kill_focus(), the returned value is *always False* because 'return command_mode is True' first checks if command_mode and True are both bool types and then returns that value. And since command_mode is not a bool type, the answer of 'command_mode is True' always gives False and the method on_kill_focus() always
returns False. It would return True *only* then when you make the variable
command_mode be a bool type, like if you would do 'command_mode = False' or
'command_mode = True' in the *same* namespace as the test 'command_mode is True' exists.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply via email to