Re: UnboundLocalError - (code is short & simple)

2009-09-28 Thread New User
Thanks for the light you shed on the "namespace" issue, and for the additional info and code example.  I'll be studying more about the info you shared.  Also, I tried out your code example, to get firsthand experience with it. Cheers, Martin --- On Mon, 9/28/09, Bruno Desthuilliers wrote: F

Re: UnboundLocalError - (code is short & simple)

2009-09-28 Thread New User
rtin --- On Mon, 9/28/09, Chris Kaynor wrote: From: Chris Kaynor Subject: Re: UnboundLocalError - (code is short & simple) To: python-list@python.org Date: Monday, September 28, 2009, 4:00 PM On Sun, Sep 27, 2009 at 10:39 PM, New User wrote: Hi Chris, Thank you for the reply and info!

RE: Unable to lookup keys in dictionary

2008-08-12 Thread Matt Fielding (R* New England)
.disconnect() except P4Exception: for e in p4.errors: print e Matt Fielding IT Technician Rockstar New England From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] org] On Behalf Of Matt Fielding (R* New England) Sent: Tuesday,

Unable to lookup keys in dictionary

2008-08-12 Thread Matt Fielding (R* New England)
h is: Traceback (most recent call last): File "test.py", line 10, in s = info['serverVersion'] TypeError: list indices must be integers If anyone has any idea what is going on here, I would appreciate the help. I've spent a few hours over the past two days trying to figure this little quirk out, but to no avail. Matt Fielding IT Technician Rockstar New England -- http://mail.python.org/mailman/listinfo/python-list

What about this?

2007-01-11 Thread new
www.magicoz.com amazing -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error? [correction]

2006-07-18 Thread Darren New
David Hopwood wrote: > Darren New wrote: > >>David Hopwood wrote: >> >> >>>public class LoopInitTest { >>>public static String getString() { return "foo"; } >>> >>>public static void main(String[] args) { &g

Re: What is a type error? [correction]

2006-07-17 Thread Darren New
Darren New wrote: > Now, if the "insert line into inputs" actually unset "line", then yes, > you're right, Hermes would complain about this. Oh, I see. You translated from Hermes into Java, and Java doesn't have the "insert into" statement. I

Re: What is a type error? [correction]

2006-07-17 Thread Darren New
could be made sufficiently intelligent to track most simple versions of this problem and not complain, by carrying around conditionals in the typestate description. -- Darren New / San Diego, CA, USA (PST) This octopus isn't tasty. Too many tentacles, not enough chops. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-17 Thread Darren New
ither. I think that's where the equality comes into it. -- Darren New / San Diego, CA, USA (PST) This octopus isn't tasty. Too many tentacles, not enough chops. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-17 Thread Darren New
ded "realtime" constraints to it. -- Darren New / San Diego, CA, USA (PST) This octopus isn't tasty. Too many tentacles, not enough chops. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-17 Thread Darren New
Chris Smith wrote: > Darren New <[EMAIL PROTECTED]> wrote: > >>I'm not sure what linear or uniqueness typing is. It's typestate, and if >>I remember correctly the papers I read 10 years ago, the folks at >>TJWatson that invented Hermes also invented th

Re: What is a type error?

2006-07-14 Thread Darren New
nowadays complain about uninitialized variables, dead code, etc. But for lots of types of programs, it let you do all kinds of things with a good assurance that they'd work safely and efficiently. It was really a language for writing operating systems in, when you get right down to it. -- Darren New / San Diego, CA, USA (PST) This octopus isn't tasty. Too many tentacles, not enough chops. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-13 Thread Darren New
;d say x was mutable, with no "identity" problems involved? Why is it problematic that variables have identity and are mutable? Certainly I can later "find" whatever value I put into x. -- Darren New / San Diego, CA, USA (PST) This octopus isn't tasty. Too many t

Re: What is a type error?

2006-07-13 Thread Darren New
mutability - which is > present in almost all imperative languages I know. :-) I disagree. It's entirely possible to make sophisticated imperitive languages with assignment and without aliasing. -- Darren New / San Diego, CA, USA (PST) This octopus isn't tasty. Too many

Re: What is a type error?

2006-07-12 Thread Darren New
enerated automatically from a description of the semantics of the input stream and the semantics of the machine the code is to run on. I'm pretty sure we're not there yet, and I'm pretty sure you start running into the limits of computability if you do that. -- Darren New

Re: What is a type error?

2006-07-12 Thread Darren New
generate moves" routine. Precondition: An input board with a valid configuration of chess pieces. Postcondition: An array of boards with possible next moves for the selected team. Heck, if you could write those as assertions, you wouldn't need the code. -- Darren New / San Diego, CA, USA (PST) This octopus isn't tasty. Too many tentacles, not enough chops. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-11 Thread Darren New
would work. x := read_integer_from_stdin(); write_to_stdout(myarray[x]); What does the programmer have to do to implement this semantic in the sort of language you're talking about? Surely something somewhere along the line has to "fail" (for some meaning of failure) at run-time, yes?

Re: What is a type error?

2006-07-11 Thread Darren New
o. Just not in a way visible to the programmer. The compiler manages to optimize out most places that different names consistantly refer to the same value. [2] There aren't subroutines. Just processes, with their own address space, to which you send and receive messages. -- Darren New

Re: What is a type error?

2006-07-11 Thread Darren New
of postconditions to optimize code or eliminate run-time checks (like null pointer testing). -- Darren New / San Diego, CA, USA (PST) This octopus isn't tasty. Too many tentacles, not enough chops. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-10 Thread Darren New
the equation there. Sadly, Hermes went the way of the dodo. -- Darren New / San Diego, CA, USA (PST) This octopus isn't tasty. Too many tentacles, not enough chops. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-10 Thread Darren New
te well if the language takes advantage of it consistantly and allows you to designate your expected typestates and such. -- Darren New / San Diego, CA, USA (PST) This octopus isn't tasty. Too many tentacles, not enough chops. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Darren New
Joachim Durchholz wrote: > That's actually not a design choice It's certainly a choice you can get wrong, as you say. ;-) I mean, if "without runtime safety" is a choice, I expect picking the wrong choice here can be. :-) -- Darren New / San Diego, CA, USA (PST)

Re: What is Expressiveness in a Computer Language

2006-06-25 Thread Darren New
, right? gets() is "safe" as long as you don't read more than the buffer you allocated. What's the difference between "safe" and "well-defined semantics"? (Ignoring for the moment things like two threads modifying the same memory at the same time and other

Re: languages with full unicode support

2006-06-25 Thread Darren New
Xah Lee wrote: > If you know a lang that does full unicode support, please let me know. Tcl. You may have to modify the "source" command to get it to default to something other than the system encoding, but this is trivial in Tcl. -- Darren New / San Diego, CA, USA (PST

Re: What is Expressiveness in a Computer Language

2006-06-25 Thread Darren New
Marshall wrote: > Also: has subtyping polymorphism or not, has parametric polymorphism or > not. And covariant or contravariant. -- Darren New / San Diego, CA, USA (PST) Native Americans used every part of the buffalo, including the wings. -- http://mail.python.org/m

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Darren New
Dr.Ruud wrote: > You can write self-modifying code in C, No, by violating the standards and invoking undefined behavior, you can write self-modifying code. I wouldn't say you're still "in C" any more, tho. -- Darren New / San Diego, CA, USA (PST) Native Am

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Darren New
uate "type" with what smalltalk calls "protocol" (i.e., the type is the collection of operators applicable to values in the type), these are two different statements. -- Darren New / San Diego, CA, USA (PST) Native Americans used every part of the buffalo, includ

Re: What is a type error?

2006-06-23 Thread Darren New
Eliot Miranda wrote: > classes do _not_ have to inherit from Object, I was unaware of this subtlety. Thanks! -- Darren New / San Diego, CA, USA (PST) Native Americans used every part of the buffalo, including the wings. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Darren New
Marshall wrote: > I can't see how you'd call + on a and b if you think they might > not be numbers. Now substitute "<" for "+" and see if you can make the same argument. :-) -- Darren New / San Diego, CA, USA (PST) Native Americans used every

Re: What is a type error?

2006-06-22 Thread Darren New
nting doesNotUnderstand. -- Darren New / San Diego, CA, USA (PST) Native Americans used every part of the buffalo, including the wings. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Darren New
John W. Kennedy wrote: > 360-family assembler, yes. 8086-family assembler, not so much. And Burroughs B-series, not at all. There was one "ADD" instruction, and it looked at the data in the addresses to determine whether to add ints or floats. :-) -- Darren New / San Diego,

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Darren New
ng compiles perfectly fine (using GNU Pascal): That'll teach me to rely on 15-year-old memories. :-) Maybe I'm remembering the wishful thinking from when I used Pascal. -- Darren New / San Diego, CA, USA (PST) My Bath Fu is strong, as I have studied under the Showerin'

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Darren New
. :-) Yah. :-) > (Btw, Pascal did not have it either, AFAIK) I'm pretty sure in Pascal you could say Type Apple = Integer; Orange = Integer; and then vars of type apple and orange were not interchangable. -- Darren New / San Diego, CA, USA (PST) My Bath Fu is strong, as I have studied under the Showerin' Monks. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Darren New
con? Perl? (Hmmm... Pascal does, IIRC.) I guess you just work with better languages than I do. :-) -- Darren New / San Diego, CA, USA (PST) My Bath Fu is strong, as I have studied under the Showerin' Monks. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Darren New
gs like usual OO languages (Eiffel, Smalltalk, etc) to have "abstract data types". -- Darren New / San Diego, CA, USA (PST) My Bath Fu is strong, as I have studied under the Showerin' Monks. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Darren New
s that don't overflow, or whether an assignment of an integer to a positive is legal, or adding a CountOfApples to a CountOfOranges is legal, or whether passing a "Dog" object to an "Animal" function parameter makes sense in a particular context. Indeed, the ability to declare

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Darren New
clear the difference between a value of (type T) and a value of (type T or one of its subtypes). -- Darren New / San Diego, CA, USA (PST) My Bath Fu is strong, as I have studied under the Showerin' Monks. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Darren New
Rob Thorpe wrote: > Darren New wrote: >>Rob Thorpe wrote: >>>The values themselves have no type information associated with them. >>int x = (int) (20.5 / 3); > In that case it knew because it could see at compile time. Well, yes. That's the point of static typing.

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Darren New
it doesn't. int x = (int) 20.5; There's no point at which bits from the floating point representation appear in the variable x. int * x = (int *) 0; There's nothing that indicates all the bits of "x" are zero, and indeed in some hardware configurations they aren't. -

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Darren New
to strings. How could this be determined at compile time if "hello" and "there" don't have types? -- Darren New / San Diego, CA, USA (PST) My Bath Fu is strong, as I have studied under the Showerin' Monks. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-16 Thread Darren New
example of a heterogenous list that would be awkward in a statically strongly-typed language. The arguments to printf() count, methinks. What would the second argument to apply be if the first argument is printf (since I'm reading this in the LISP group)? -- Darren New / San Di

Re: What is Expressiveness in a Computer Language

2006-06-16 Thread Darren New
; or some such. Second, what's the type of the argument that printf, sprintf, fprintf, kprintf, etc all pass to the subroutine that actually does the formatting? (Called vprintf, I think?) -- Darren New / San Diego, CA, USA (PST) My Bath Fu is strong, as I have studied under t

Re: What is Expressiveness in a Computer Language

2006-06-16 Thread Darren New
Joachim Durchholz wrote: > Give a heterogenous list that would to too awkward to live in a > statically-typed language. Printf()? -- Darren New / San Diego, CA, USA (PST) My Bath Fu is strong, as I have studied under the Showerin' Monks. -- http://mail.python.org/mailm

Re: What is Expressiveness in a Computer Language

2006-06-16 Thread Darren New
's useful. See the Tcl "unknown" proc, used for interactive command expansion, dynamic loading of code on demand, etc. -- Darren New / San Diego, CA, USA (PST) My Bath Fu is strong, as I have studied under the Showerin' Monks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Detect character encoding

2005-12-05 Thread The new guy
Michal wrote: > Hello, > is there any way how to detect string encoding in Python? > > I need to proccess several files. Each of them could be encoded in > different charset (iso-8859-2, cp1250, etc). I want to detect it, and > encode it to utf-8 (with string function encode). Well, about how to

How to obtain GMT offset?

2005-08-15 Thread new pip
I'm using Windows os. If the current system date time is '28 Jun 2001 14:17:15 +0700', how can I obtain the value '+0700' using python? Thank you -- http://mail.python.org/mailman/listinfo/python-list

RotatingFileHandler in Python 2.3.5

2005-05-16 Thread new pip
Is the RotatingFileHandler (from the logging module) available in Python 2.3.5? I'm getting a "AttributeError: 'module' object has no attribute 'RotatingFileHandler'" error message when trying to use it. Thank you -- http://mail.python.org/mailman/listinfo/python-list

RE: Detect console close

2005-05-16 Thread new pip
> > >new pip wrote: >> In Windows, when I double click on my .py file, the program runs with >> a console. How can I detect when the console is closed? Any code >> samples are appreciated. > >When the console has closed, your program has already exited, if I >u

Detect console close

2005-05-15 Thread new pip
In Windows, when I double click on my .py file, the program runs with a console. How can I detect when the console is closed? Any code samples are appreciated. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

LOCAL NYC - UNIGROUP 17-FEB-2005 (Thurs): ZOPE - Open Source Web Development

2005-02-15 Thread Unigroup of New York
Subject: LOCAL NYC - UNIGROUP 17-FEB-2005 (Thurs): ZOPE - Open Source Web Development Unigroup's February 2005 meeting is THIS Thursday... = UNIGROUP OF NEW YORK - UNIX USERS GROUP - FEBRUARY 2005 ANNOUNCE