Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-18 Thread Steven
On Sat, 19 Apr 2008 12:18:47 +1200 Greg Ewing <[EMAIL PROTECTED]> wrote: > Antoine Pitrou wrote: > > > Why do you want to derive program bugs from EnvironmentError ? Usually I > > derive > > them from ValueError, RuntimeError or simply Exception. > > I'm *not* talking about program bugs, I'm ta

Re: [Python-Dev] unscriptable?

2008-04-18 Thread Greg Ewing
Michael Foord wrote: > It seems to be more common in the 'Python world' to refer to indexing > than subscription Especially since the subscript isn't actually written as a subscript, unless you have a particulary fancy code editor... -- Greg ___ Pytho

Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-18 Thread Greg Ewing
Antoine Pitrou wrote: > Why do you want to derive program bugs from EnvironmentError ? Usually I > derive > them from ValueError, RuntimeError or simply Exception. I'm *not* talking about program bugs, I'm talking about exceptions due to something the user did wrong. I like to be able to do thi

Re: [Python-Dev] unscriptable?

2008-04-18 Thread Martin v. Löwis
> I tend to agree with Benjamin that "unsubscriptable" is a made-up word, > but so is "unindexable". So, whatever. FWIW, here is what other tools give as error message in similar cases: gcc: subscripted value is neither array nor pointer g++: invalid types ‘double[int]’ for array subscript javac

Re: [Python-Dev] unscriptable?

2008-04-18 Thread Michael Foord
Scott Dial wrote: > Benjamin Peterson wrote: > >> Consider this error: >> > 3["something"] > >> Traceback (most recent call last): >> File "", line 1, in >> TypeError: 'int' object is unsubscriptable >> >> "unscriptable" seems rather ambiguous. How about "[object] cann

Re: [Python-Dev] unscriptable?

2008-04-18 Thread Scott Dial
Benjamin Peterson wrote: > Consider this error: 3["something"] > Traceback (most recent call last): > File "", line 1, in > TypeError: 'int' object is unsubscriptable > > "unscriptable" seems rather ambiguous. How about "[object] cannot be indexed"? > Although I think this is a bit of bi

Re: [Python-Dev] unscriptable?

2008-04-18 Thread Benjamin Peterson
On Fri, Apr 18, 2008 at 5:43 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > Consider this error: > >>> 3["something"] > Traceback (most recent call last): > File "", line 1, in > TypeError: 'int' object is unsubscriptable > > "unscriptable" seems rather ambiguous. How about "[object] can

[Python-Dev] unscriptable?

2008-04-18 Thread Benjamin Peterson
Consider this error: >>> 3["something"] Traceback (most recent call last): File "", line 1, in TypeError: 'int' object is unsubscriptable "unscriptable" seems rather ambiguous. How about "[object] cannot be indexed"? -- Cheers, Benjamin Peterson ___

Re: [Python-Dev] Interface to change Py3kWarning in Python

2008-04-18 Thread Benjamin Peterson
On Fri, Apr 18, 2008 at 7:38 AM, Christian Heimes <[EMAIL PROTECTED]> wrote: > Benjamin Peterson schrieb: > > > > In Python we usually have to methods for the job, like > set_py3kwarningmode and get_py3kwarningmode. I don't like the enable* > and disable* style. Even the get/set methods are an u

Re: [Python-Dev] Proposed unittest changes

2008-04-18 Thread Nick Coghlan
Michael Foord wrote: > that the 'assert' statement should be used > instead of 'assert_'. assert statements are actually a bad idea in tests - they get skipped when the test suite is run with optimisation switched on. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Austr

[Python-Dev] Summary of Tracker Issues

2008-04-18 Thread Tracker
ACTIVITY SUMMARY (04/11/08 - 04/18/08) Tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue number. Do NOT respond to this message. 1839 open (+31) / 12641 closed ( +7) / 14480 total (+38) Open issues with patches: 550 Average durati

Re: [Python-Dev] Known doctest bug with unicode?

2008-04-18 Thread Adam Olsen
On Fri, Apr 18, 2008 at 8:27 AM, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> wrote: > # vim: set fileencoding=utf-8 : > > kanamap = { > u'あ': 'a' > } > > def transpose(word): > """Convert a word in kana to its equivalent Hepburn romanisation. > > >>> transpose(u'あ') > 'a' >

Re: [Python-Dev] Need help in MAPI

2008-04-18 Thread Amaury Forgeot d'Arc
Hello, Antony Joseph wrote: > Hi, > > My Code: > mapi.MAPIInitialize(None) > session = mapi.MAPILogonEx(0, MAPIProfile, None, > mapi.MAPI_EXTENDED | mapi.MAPI_USE_DEFAULT) > > I am trying to send a mail using the extended MAPI interface, I am > new to work with MA

Re: [Python-Dev] Known doctest bug with unicode?

2008-04-18 Thread Jeroen Ruigrok van der Werven
# vim: set fileencoding=utf-8 : kanamap = { u'あ': 'a' } def transpose(word): """Convert a word in kana to its equivalent Hepburn romanisation. >>> transpose(u'あ') 'a' """ transposed = '' for character in word: transposed += kanamap[character] return tr

Re: [Python-Dev] Known doctest bug with unicode?

2008-04-18 Thread Atul Varma
Can you provide an example that fails? This seems to work on my end, for instance: >>> mydict = { u'\u2026' : 'ellipsis' } >>> mydict[u'\u2026'] 'ellipsis' - Atul On Fri, Apr 18, 2008 at 7:12 AM, Jeroen Ruigrok van der Werven < [EMAIL PROTECTED]> wrote: > Is it a known doctest bug that w

[Python-Dev] Known doctest bug with unicode?

2008-04-18 Thread Jeroen Ruigrok van der Werven
Is it a known doctest bug that when you have a dict with Unicode key values that doctest dies with a KeyError? When I excute my code from the regular python interpreter it works as expected. -- Jeroen Ruigrok van der Werven / asmodai イェルーン ラウフロック ヴァン デル ウェルヴェン http://www.in-nomine.org/ | http:/

[Python-Dev] Need help in MAPI

2008-04-18 Thread Antony Joseph
Hi, My Code: mapi.MAPIInitialize(None) session = mapi.MAPILogonEx(0, MAPIProfile, None, mapi.MAPI_EXTENDED | mapi.MAPI_USE_DEFAULT) I am trying to send a mail using the extended MAPI interface, I am new to work with MAPI. I am trying to execute your code,i getting

Re: [Python-Dev] Interface to change Py3kWarning in Python

2008-04-18 Thread Christian Heimes
Benjamin Peterson schrieb: > I currently have a patch to make it possible to change py3k warnings > in Python through new functions in sys: issue 2458. I realize the > functions are rather ugly, but I don't think there is another > practical way to do it unless you want to be writing PySys_GetObjec

Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-18 Thread Antoine Pitrou
Greg Ewing canterbury.ac.nz> writes: > > Really? Nobody else wants a convenient way to > distinguish program bugs from exceptions caused > by external factors? Why do you want to derive program bugs from EnvironmentError ? Usually I derive them from ValueError, RuntimeError or simply Exception.