Re: [Python-Dev] Explicitly declaring expected exceptions for a block

2005-06-20 Thread Dmitry Dvoinikov
> If you're trying to write tests, perhaps a better use-case would be > something like: > with required_exception(SomeError): > do something that should cause SomeError Yes, you are right, that'd be a better and more flexible way, thank you. Sincerely, Dmitry Dvoinikov http://www.targeted.or

Re: [Python-Dev] Explicitly declaring expected exceptions for a block

2005-06-20 Thread Paul Du Bois
On 6/20/05, Dmitry Dvoinikov <[EMAIL PROTECTED]> wrote: > Excuse me if I couldn't find that in the existing PEPs, but > wouldn't that be useful to have a construct that explicitly > tells that we know an exception of specific type could happen > within a block, like: > ignore TypeError: > do s

[Python-Dev] Explicitly declaring expected exceptions for a block

2005-06-20 Thread Dmitry Dvoinikov
Excuse me if I couldn't find that in the existing PEPs, but wouldn't that be useful to have a construct that explicitly tells that we know an exception of specific type could happen within a block, like: -- ignore TypeError: do stuff [else: do other stuff]

Re: [Python-Dev] Is PEP 237 final -- Unifying Long Integers and Integers

2005-06-20 Thread Keith Dart
On Mon, 20 Jun 2005, Keith Dart wrote: > But then I wouldn't know if it overflowed 32 bits. In my usage, the > integer will be translated to an unsigned (32 bit) integer in another > system (SNMP). I want to know if it will fit, and I want to know early if > there will be a problem, rather than la

Re: [Python-Dev] Is PEP 237 final -- Unifying Long Integers and Integers

2005-06-20 Thread Keith Dart
On Mon, 20 Jun 2005, Guido van Rossum wrote: > [Keith Dart] >> In SNMP, for example, a Counter32 is basically an unsigned int, defined >> as "IMPLICIT INTEGER (0..4294967295)". One cannot efficiently translate >> and use that type in native Python. Currently, I have defined an >> "unsigned" type a

[Python-Dev] Recommend accepting PEP 312 -- Simple Implicit Lambda

2005-06-20 Thread Jim Jewett
>>>lambda x,y: x+y*y >>>lambda x,y: y**2+x >>> are essentialy the same functions with different implementations [1]. >> Except that they are not. Think of __pow__, think of __add__ and __radd__. > You know the difference between the concept of a function and it's

Re: [Python-Dev] Multiple interpreters not compatible with current thread module

2005-06-20 Thread Michael Hudson
Michael Hudson <[EMAIL PROTECTED]> writes: > I'm not expecting anyone else to think hard about this on recent form, > so I'll think about it for a bit and then fix it in the way that seems > best after that. Feel free to surprise me. And so that's what I did. I think I got this right, but threa

Re: [Python-Dev] Multiple expression eval in compound if statement?

2005-06-20 Thread Michael Chermside
Gerrit Holl writes: > What would happen if... Raymond replies: > Every molecule in your body would simultaneously implode at the speed of > light. So you're saying it triggers C-language "undefined behavior"? -- Michael Chermside ___ Python-Dev mailin

Re: [Python-Dev] Is PEP 237 final -- Unifying Long Integers and Integers

2005-06-20 Thread Guido van Rossum
[Keith Dart] > In SNMP, for example, a Counter32 is basically an unsigned int, defined > as "IMPLICIT INTEGER (0..4294967295)". One cannot efficiently translate > and use that type in native Python. Currently, I have defined an > "unsigned" type as a subclass of long, but I don't think that would b

Re: [Python-Dev] Recommend accepting PEP 312 -- Simple Implicit Lambda

2005-06-20 Thread Guido van Rossum
[Nick Coghlan] > And here we see why I'm such a fan of the term 'deferred expression' > instead of 'anonymous function'. > > Python's lambda expressions *are* the former, but they are > emphatically *not* the latter. Let me emphatically disagree. Your POV is entirely syntactical, which IMO is a s