You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2014/05/21 18:22:07 UTC

[Issue 124953] New: [PyUNO] Add __ne__ method to UNO types

https://issues.apache.org/ooo/show_bug.cgi?id=124953

          Issue ID: 124953
        Issue Type: DEFECT
           Summary: [PyUNO] Add __ne__ method to UNO types
           Product: App Dev
           Version: 4.1.0
          Hardware: All
                OS: All
            Status: CONFIRMED
          Severity: normal
          Priority: P3
         Component: scripting
          Assignee: issues@openoffice.apache.org
          Reporter: hanya.runo@gmail.com

If user defined class does not have __eq__ method, (a == b) is identification
check of these instances.
If __eq__ is defined, the customized identical comparizon can be done. If
__ne__ 
method is not defined in the same class, (a != b) comparizon is still identical
comparizon of the instances. 

uno.Enum is used to describe one of enum constants from UNO. So Enum.__eq__
method 
is returns True if typename and value are the same. But Enum.__ne__ is not
defined 
and so, the result of the comparizon with an value instantiated other place by
!= operator returns True. 
Because these are not the same instance.

uno.Enum, Type, Char, ByteSequence classes have to have __ne__ method. 
And also _uno_struct__eq__ method for UNO struct should be defined.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 124953] [PyUNO] Add __ne__ method to UNO types

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124953

--- Comment #3 from hanya <ha...@gmail.com> ---
Created attachment 83451
  --> https://issues.apache.org/ooo/attachment.cgi?id=83451&action=edit
Test file that contains unittest case

Execute "run" procedure as Python macro to execute the test case. 
self.assertFalse call method fails in all five tests on current implementation
of uno.py.
With the attached patch, all tests should be passed.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 124953] [PyUNO] Add __ne__ method to UNO types

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124953

--- Comment #1 from hanya <ha...@gmail.com> ---
If someone use != operator for identification check, the code would break. 
Maybe the next major update is the chance to introduce the change.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 124953] [PyUNO] Add __ne__ method to UNO types

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124953

--- Comment #2 from hanya <ha...@gmail.com> ---
Created attachment 83450
  --> https://issues.apache.org/ooo/attachment.cgi?id=83450&action=edit
Patch to add __ne__ method to some classes

The patch contains __ne__ methods for Enum, Type, Char, ByteSequence and
structs.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 124953] [PyUNO] Add __ne__ method to UNO types

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124953

--- Comment #4 from hanya <ha...@gmail.com> ---
This kind of changes might give different behavior for user's scripts. 
Should be applied when major update is planned, maybe version 5.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.