[issue36524] identity operator

2019-04-04 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue36524] identity operator

2019-04-04 Thread Rocco Santoro
Rocco Santoro added the comment: You are right. The documentation, that I know, is clear. Anyway in this case "is" and "==" provides the same outcome and this is my remark, that I called bug, wrongly. The reason is the nature of print(), as function, that always remains always NoneType with

[issue36524] identity operator

2019-04-04 Thread SilentGhost
SilentGhost added the comment: Rocco, == is an equality operator, "is" is used for identity testing. If you have an example of documentation that states that == is an identity operator, do report it and we'd be glad to fix it. The print function does not change the object, it's the print fun

[issue36524] identity operator

2019-04-04 Thread Rocco Santoro
Rocco Santoro added the comment: Thanks you very much for the explanations. I am sorry for bothering you, actually my question concerned the use of identity operator. I suggest that '==' means equal not identity. Therefore, it concerns the instance not the ontology and makes a comparison be

[issue36524] identity operator

2019-04-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Rocco, please ask questions about Python on python-list or places like stackoverflow.com. 1. If python behavior puzzles you, the chance that it is a python bug is well less than 1 in 1000. 2. The answer you get will be much more visible to others who have

[issue36524] identity operator

2019-04-04 Thread SilentGhost
SilentGhost added the comment: You seem to be confused by the fact that print function returns None and therefore all the comparisons you're making return False. There is not type vs "outcome" difference in your code sample. -- assignee: terry.reedy -> nosy: +SilentGhost -eric.smith

[issue36524] identity operator

2019-04-04 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure what you're asking here. You're comparing the result of the print function to a value. Print returns None, so it doesn't compare equal to any of the values you're comparing it to. To see what's happening, try: >>> print(None) == None None True

[issue36524] identity operator

2019-04-04 Thread Rocco Santoro
New submission from Rocco Santoro : Hi all Why the identity operator and '==' are both applied to the type (see above)? Is it not convenient to distinguish them? I mean the identity operator applied to the type and '==' applied to the outcome. Thanks for the attention Best regards Rocco San