[issue4345] Implement nb_nonzero for PyTclObject

2012-03-13 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I'm closing the issue. People who want to check for an empty string 
representation can just convert the tcl objects to strings themselves. I agree 
with Mark that implementing nonzero is too ambiguous.

--
nosy: +loewis
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue4345] Implement nb_nonzero for PyTclObject

2010-08-04 Thread Guilherme Polo

Guilherme Polo  added the comment:

> I assume that Tcl_GetCharLength works for any object, regardless of
> its internal representation?

I didn't look at its code but I assume it will create a string representation 
for the object in question if there isn't one in place when the call happens, 
so this means I /believe/ it will work for any Tcl object.

> Can you update the patch for py3k, and add docs and tests?

I can do it (maybe the test part may not be excellent), but not at this moment.

Btw, I'm happy that you mentioned that doc requirement about unexpected results 
because I was going to write about it in my previous reply but I thought my 
English could hurt its meaning and negatively affect you.

--

___
Python tracker 

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



[issue4345] Implement nb_nonzero for PyTclObject

2010-08-04 Thread Mark Dickinson

Mark Dickinson  added the comment:

> If you want to expand it to handle other data types, I'm ok with it
> but I predict troubles for you.

Yes, I suspected as much.  I don't know much Tcl, but I'm definitely prepared 
to believe you on this point. :)  I'd be fine with this patch if there's some 
documentation somewhere that points out that the bool() might give unexpected 
results (for Python users) for zeros, empty lists, etc.

I assume that Tcl_GetCharLength works for any object, regardless of its 
internal representation?

Can you update the patch for py3k, and add docs and tests?

--

___
Python tracker 

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



[issue4345] Implement nb_nonzero for PyTclObject

2010-08-04 Thread Guilherme Polo

Guilherme Polo  added the comment:

Mark,

If you want to expand it to handle other data types, I'm ok with it
but I predict troubles for you. The problem is that in Tcl there is
only one "real" data type -- string. Depending on how you operate over
a value it is then, internally, treated as something more specific but
this is not directly exposed for the "API users".

--

___
Python tracker 

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



[issue4345] Implement nb_nonzero for PyTclObject

2010-08-04 Thread Mark Dickinson

Mark Dickinson  added the comment:

I'd call this a new feature;  removing 2.7 and 3.1 from versions.

The patch needs updating for py3k, which should be a fairly simple task.

I don't know much about Tcl, but wouldn't this change give quite confusing 
results for numeric values?  Presumably, all integers and floats would have a 
bool() of True?  (Or am I misunderstanding?)  I'm not sure what the value of 
implementing __nonzero__ is if it only works as expected for strings.

--
nosy: +mark.dickinson
type:  -> feature request
versions:  -Python 2.7, Python 3.1

___
Python tracker 

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



[issue4345] Implement nb_nonzero for PyTclObject

2010-08-04 Thread Mark Lawrence

Mark Lawrence  added the comment:

The patch changes _tkinter.c so can a C guru take a look please.

--
nosy: +BreamoreBoy
stage:  -> patch review
versions: +Python 3.1, Python 3.2 -Python 2.6, Python 3.0

___
Python tracker 

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



[issue4345] Implement nb_nonzero for PyTclObject

2008-11-18 Thread Guilherme Polo

New submission from Guilherme Polo <[EMAIL PROTECTED]>:

Implementing it makes this "crazy" check in
http://bugs.python.org/issue3767
(http://bugs.python.org/file12043/tkColorChooser.diff) be no longer needed

--
components: Tkinter
files: _tkinter__nonzero__.diff
keywords: patch
messages: 76008
nosy: gpolo
severity: normal
status: open
title: Implement nb_nonzero for PyTclObject
versions: Python 2.6, Python 2.7, Python 3.0
Added file: http://bugs.python.org/file12044/_tkinter__nonzero__.diff

___
Python tracker <[EMAIL PROTECTED]>

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