[issue10880] do_mkvalue and 'boolean'

2021-11-26 Thread Irit Katriel


Irit Katriel  added the comment:

Maybe 'p' as in  https://docs.python.org/3/c-api/arg.html#other-objects ?

--
components: +C API
nosy: +iritkatriel
type:  -> enhancement
versions: +Python 3.11 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2019-06-08 Thread Owais Kazi


Owais Kazi  added the comment:

If it's a easy patch, I would like to pick it up. Can someone please explain 
how should I proceed with this? I am already done with the setup.
TIA

--
nosy: +Owais Kazi
type: enhancement -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2019-03-15 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2014-06-27 Thread Mark Lawrence

Mark Lawrence added the comment:

Can somebody do a patch review on this please, it's against _testcapimodule.c.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-02-27 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

This test is wrong::
   if (!PyBool_Check(test_var)  test_var == Py_False)
the second part is never executed.
   if (test_var != Py_False)
is enough to test the return value.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-02-27 Thread Yuriy

Yuriy iro...@mail.ru added the comment:

+test_var = Py_BuildValue(?, 0);
+if (PyBool_Check(test_var)  test_var == Py_True) {
+PyErr_SetString(TestError, Failed to Create boolean);
+return NULL;
+}
+
+test_var = Py_BuildValue(?, 1);
+if (PyBool_Check(test_var)  test_var == Py_False) {
+PyErr_SetString(TestError, Failed to Create boolean);
+return NULL;
+}

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-02-27 Thread Yuriy

Yuriy iro...@mail.ru added the comment:

sorry ^_^

+test_var = Py_BuildValue(?, 0);
+if (!PyBool_Check(test_var) || test_var == Py_True) {
+PyErr_SetString(TestError, Failed to Create boolean);
+return NULL;
+}
+
+test_var = Py_BuildValue(?, 1);
+if (!PyBool_Check(test_var) || test_var == Py_False) {
+PyErr_SetString(TestError, Failed to Create boolean);
+return NULL;
+}

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-02-27 Thread Dj Gilcrease

Dj Gilcrease digitalx...@gmail.com added the comment:

Correct the tests. They passed before but had a logic flaw that caused them to 
never test that the correct boolean value was being returned.

--
Added file: http://bugs.python.org/file20938/issue10880_68064.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-02-27 Thread Dj Gilcrease

Changes by Dj Gilcrease digitalx...@gmail.com:


Removed file: http://bugs.python.org/file20929/issue10880_rev68064.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-02-26 Thread Dj Gilcrease

Dj Gilcrease digitalx...@gmail.com added the comment:

Add a boolean format option to Py_BuildValue and Py_VaBuildValue

Also added some tests to test_capi that verifies Py_BuildValue is building the 
right type. I did not add tests for every possible type as it has lived this 
long without, but I did want to test my new code.

--
keywords: +patch
nosy: +Digitalxero
Added file: http://bugs.python.org/file20929/issue10880_rev68064.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-01-11 Thread Sergey Shepelev

Sergey Shepelev temo...@gmail.com added the comment:

Here's patch against 2.6


--- a/Python/modsupport.c   Tue Aug 24 18:19:58 2010 +0200
+++ b/Python/modsupport.c   Tue Jan 11 23:50:40 2011 +0300
@@ -459,6 +459,16 @@
 return v;
 }
 
+case '?':
+{
+int n;
+n = va_arg(*p_va, int);
+if (n == 0)
+Py_RETURN_FALSE;
+else
+Py_RETURN_TRUE;
+}
+
 case ':':
 case ',':
 case ' ':

--
nosy: +temoto

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-01-10 Thread Yuriy

New submission from Yuriy iro...@mail.ru:

If a value created by Py_VaBuildValue and parameter b is transfered - a 
PyLong_Type value is returned despite of the fact that it would be reasonable 
if PyBool_Type were returned. Are there any reasons for this?

modsupport.c Ln 214

--
messages: 125903
nosy: IROV
priority: normal
severity: normal
status: open
title: do_mkvalue and 'boolean'
type: behavior
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-01-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

What makes you think it should be a boolean?
in http://docs.python.org/py3k/c-api/arg.html#Py_BuildValue b means byte 
and is processed as a tiny integer.

Now, that's true that Py_BuildValue could have a format for boolean values.  
Maybe with a ? parameter?

--
nosy: +amaury.forgeotdarc
type: behavior - feature request

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-01-10 Thread Yuriy

Yuriy iro...@mail.ru added the comment:

Thank you, how is it possible to ask the developers to add such a flag?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-01-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

This is the right place to ask... but it will be faster if someone provides a 
patch.

--
keywords: +easy
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10880] do_mkvalue and 'boolean'

2011-01-10 Thread Yuriy

Yuriy iro...@mail.ru added the comment:

case 'g':
{
int n;
n = va_arg(*p_va, int);

if (n == 0)
Py_RETURN_FALSE;
else
Py_RETURN_TRUE;
}

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com