After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 470230 - check for default value in boolean type is wrong
check for default value in boolean type is wrong
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other All
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2007-08-25 16:10 UTC by Marco Giusti
Modified: 2007-08-27 13:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a simple test (294 bytes, text/x-python)
2007-08-25 16:24 UTC, Marco Giusti
  Details
a simple patch (627 bytes, patch)
2007-08-25 16:25 UTC, Marco Giusti
committed Details | Review
this is a patch test for tests/test_properties.py (1.59 KB, patch)
2007-08-25 17:30 UTC, Marco Giusti
committed Details | Review

Description Marco Giusti 2007-08-25 16:10:51 UTC
Please describe the problem:
the check

    (default is not True or default is not False)

is always true, even for True or False

Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Marco Giusti 2007-08-25 16:24:22 UTC
Created attachment 94318 [details]
a simple test
Comment 2 Marco Giusti 2007-08-25 16:25:30 UTC
Created attachment 94319 [details] [review]
a simple patch
Comment 3 Johan (not receiving bugmail) Dahlin 2007-08-25 16:37:20 UTC
(In reply to comment #2)
> Created an attachment (id=94319) [edit]
> a simple patch
> 

Looks good, can you add a test?
Comment 4 Paul Pogonyshev 2007-08-25 16:48:35 UTC
AFAIK, not in uses == for comparison.  While this is hardly important, maybe it is better to use  "default is not True and default is not False" still.
Comment 5 Paul Pogonyshev 2007-08-25 17:07:47 UTC
>>> 1 in (True, False)
True
Comment 6 Marco Giusti 2007-08-25 17:30:47 UTC
Created attachment 94320 [details] [review]
this is a patch test for tests/test_properties.py
Comment 7 Marco Giusti 2007-08-25 17:34:13 UTC
>>> bool.__bases__
(<type 'int'>,)
Comment 8 Gustavo Carneiro 2007-08-27 13:13:14 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.