Re: The Industry choice

2004-12-31 Thread Peter Dembinski
Thomas Bartkus [EMAIL PROTECTED] writes: [...] What makes such companies to choose Java over dynamic, productive languages like Python? Are there any viable, technical reasons for that? Are there viable, technical reasons? That would be doubtful. But There is a reason very

Re: The Industry choice

2004-12-31 Thread Peter Dembinski
Paul Rubin http://[EMAIL PROTECTED] writes: [...] I'm involved in a development project for something that's security critical and has to be reliable. The implementation language hasn't been chosen yet. Python and Java are both possibilities. I'm fine with the idea of using Python for

Re: The Industry choice

2005-01-02 Thread Peter Dembinski
Paul Rubin http://[EMAIL PROTECTED] writes: [...] I don't understand that. If I see str x = str(3), then I know that x is a string. def foo(x): return str(x) str = foo(x) And now, let's say that foo()'s definition is in another module. It is hard for a programmer to quickly determine

Re: The Industry choice

2005-01-02 Thread Peter Dembinski
Donn Cave [EMAIL PROTECTED] writes: [...] For me, the effect is striking. I pound out a little program, couple hundred lines maybe, and think hm, guess that's it and save it to disk. Run the compiler, it says no, that's not it - look at line 49, where this expression has type string but

[OT] Re: The Industry choice

2005-01-02 Thread Peter Dembinski
Paul Rubin http://[EMAIL PROTECTED] writes: Peter Dembinski [EMAIL PROTECTED] writes: If it has to be both reliable and secure, I suggest you used more redundant language such as Ada 95. That's something to think about and it's come up in discussions, but probably complicates stuff since

Re: The Industry choice

2005-01-02 Thread Peter Dembinski
Bulba! [EMAIL PROTECTED] writes: [...] The point is obviously cover your ass attitude of managers: Managers get paid for taking risk :) -- http://mail.python.org/mailman/listinfo/python-list

Re: The Industry choice

2005-01-03 Thread Peter Dembinski
Peter Hansen [EMAIL PROTECTED] writes: Roy Smith wrote: Terry Reedy [EMAIL PROTECTED] wrote: None has been reserved because there is no known good use for overriding it. Should I infer from the above that there's a known bad use? Yes: making None equal to the integer 3. That's one of

[OT] Re: The Industry choice

2005-01-06 Thread Peter Dembinski
Bulba! [EMAIL PROTECTED] writes: [...] That's remarkable, first time I see smth like this - out of curiosity, could you say a word where was that? Are you the same Bulba I know from alt.pl.comp.os.hacking? -- http://mail.python.org/mailman/listinfo/python-list

Re: idiom for constructor?

2005-06-04 Thread Peter Dembinski
Steven Bethard [EMAIL PROTECTED] writes: Mac wrote: Is there a nice Python idiom for constructors which would expedite the following? class Foo: def __init__(self, a,b,c,d,...): self.a = a self.b = b self.c = c self.d = d ... py class Foo(object): ... def

Re: idiom for constructor?

2005-06-04 Thread Peter Dembinski
Peter Dembinski [EMAIL PROTECTED] writes: [snap] Eh, sorry, it should look like this: #v+ class A: def __init__(self, a, b, c, d): initial = {'a' : 1, 'b' : 2, 'c' : 3, 'd' : 4} initial = {'a' : a, 'b' : b, 'c' : c, 'd' : d} for param

Re: idiom for constructor?

2005-06-04 Thread Peter Dembinski
Steven Bethard [EMAIL PROTECTED] writes: Peter Dembinski wrote: class A: def __init__(self, a, b, c, d): initial = {'a' : a, 'b' : b, 'c' : c, 'd' : d} for param in initial.keys(): exec self.%s = initial['%s'] % (param, param) This is not a good use case

Re: Scope

2005-06-04 Thread Peter Dembinski
Elliot Temple [EMAIL PROTECTED] writes: I want to write a function, foo, so the following works: def main(): n = 4 foo(n) print n #it prints 7 if foo needs to take different arguments, that'd be alright. Is this possible? It is possible, but the more natural way would

Re: Scope

2005-06-05 Thread Peter Dembinski
Steven Bethard [EMAIL PROTECTED] writes: Peter Dembinski wrote: AFAIK inc is builtin function. And builtin functions doesn't have to be real functions, they can be just aliases to Python's VM bytecodes or sets of bytecodes. Wrong on both counts. ;) Yup. My mistake. [snap] And while

Re: python bytecode grammar

2005-06-12 Thread Peter Dembinski
Terry Reedy [EMAIL PROTECTED] writes: M1st0 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] where I can find the grammar of python bytecode ? ( better if is in BCF I believe the top-level production is something like BYTECODE := (OPCODE ARGS)* ROTFL :) --

Re: How to get/set class attributes in Python

2005-06-12 Thread Peter Dembinski
Kalle Anke [EMAIL PROTECTED] writes: [snap] sys.maxint = -12345 I don't really understand what you're meaning. He meant None = 1 : -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get/set class attributes in Python

2005-06-12 Thread Peter Dembinski
vincent wehren [EMAIL PROTECTED] writes: Peter Dembinski [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] | Kalle Anke [EMAIL PROTECTED] writes: | | [snap] | | sys.maxint = -12345 | | I don't really understand what you're meaning. | | He meant None = 1 : I'm sure

Re: How to get/set class attributes in Python

2005-06-12 Thread Peter Dembinski
Bruno Desthuilliers [EMAIL PROTECTED] writes: [snap] Being an untyped language, Python does not require you to enforce types. Nope. Python *is* typed. But it doesnt confuse implementation with semantic. Python is typed. And its type system may look strange for anyone who did only Java or

Re: What is different with Python ?

2005-06-12 Thread Peter Dembinski
Steven D'Aprano [EMAIL PROTECTED] writes: [snap] new_text = for word in text: new_text = new_text + process(word) new_text = .join(map(process, text)) (I couldn't resist) -- http://mail.python.org/mailman/listinfo/python-list

Re: python bytecode grammar

2005-06-12 Thread Peter Dembinski
Terry Reedy [EMAIL PROTECTED] writes: Peter Dembinski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Terry Reedy [EMAIL PROTECTED] writes: I believe the top-level production is something like BYTECODE := (OPCODE ARGS)* ROTFL :) Glad to make your day ;-) You are welcome

Re: implicit variable declaration and access

2005-06-13 Thread Peter Dembinski
Benji York [EMAIL PROTECTED] writes: [snap] code = x + '= 0' exec(code) You should generally stay away from exec for lots of reasons. Code 'refactorizability' is one of them. -- http://mail.python.org/mailman/listinfo/python-list

Re: implicit variable declaration and access

2005-06-13 Thread Peter Dembinski
Tom Anderson [EMAIL PROTECTED] writes: [snap] The MAtrix had evarything in it: guns, a juimping off teh walls, flying guns, a bullet tiem, evil computar machenes, numbers that flew, flying gun bullets in slowar motian, juimping into a gun, dead police men, computar hackeing, Kevin Mitnick,

Re: UML to Python/Java code generation

2005-06-17 Thread Peter Dembinski
Grigoris Tsolakidis [EMAIL PROTECTED] writes: There is tool to generate UML from Python Code... The best is human brain. -- http://mail.python.org/mailman/listinfo/python-list

Refactoring in Python.

2005-04-19 Thread Peter Dembinski
I am trying to write Master Thesis on refactoring Python code. Where should I look for information? -- http://www.dembiski.prv.pl -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactoring in Python.

2005-04-19 Thread Peter Dembinski
Skip Montanaro [EMAIL PROTECTED] writes: Peter I am trying to write Master Thesis on refactoring Python Peter code. Where should I look for information? I'm not sure, but one piece of code to check out would probably be Bicycle Repair Man, a early-stage prototype refactoring tool

Re: Refactoring in Python.

2005-04-20 Thread Peter Dembinski
[EMAIL PROTECTED] writes: Investigate the CVS histories of the few 1000s python projects available at www.sourceforge.net I don't work with these guys : -- http://www.pdemb.prv.pl -- http://mail.python.org/mailman/listinfo/python-list

Re: Can .py be complied?

2005-04-30 Thread Peter Dembinski
[EMAIL PROTECTED] (John J. Lee) writes: [snap] Until they install the next program that does this. If we talk about _real_ users from the _real_ world, the most of them would just kill the app (or what is the name for stopping running program in w32) when the download begins[1] :) [1] 'hey,

Re: Python features

2005-05-12 Thread Peter Dembinski
On Sun, 08 May 2005 10:02:42 +0200, Andr Roberge [EMAIL PROTECTED] wrote: [...] google for python and functional; first link: http://www-106.ibm.com/developerworks/linux/library/l-prog.html [...] Imperative programming languages are the most commonly used languages. Examples of this

Re: function with variable arguments

2005-05-13 Thread Peter Dembinski
On Fri, 13 May 2005 11:52:34 +0200, Xah Lee [EMAIL PROTECTED] wrote: i wanted to define a function where the number of argument matters. Example: def Range(n): return range(n+1) def Range(n,m): return range(n,m+1) def Range(n,m,step): return range(n,m+1,step) this obvious

Re: Precision?

2005-05-15 Thread Peter Dembinski
Steffen Glckselig [EMAIL PROTECTED] writes: Hello, I've just wanted to check Python's abilities as a calculator and this is what came out: 1.0 + 3.0 + 4.6 8.5996 Ehm, how could I get the intuitively 'correct' result of - say - 8.6? ;-) This is as correct as your computer's

Re: question about the id()

2005-05-16 Thread Peter Dembinski
Skip Montanaro [EMAIL PROTECTED] writes: kyo Can someone explain why the id() return the same value, and kyo why these values are changing? Instance methods are created on-the-fly. So, the interpreter creates new 'point in address space' every time there is object-dot-method

Re: question about the id()

2005-05-16 Thread Peter Dembinski
[EMAIL PROTECTED] (Bengt Richter) writes: [snap] So, the interpreter creates new 'point in address space' every time there is object-dot-method invocation in program? [optimization] BTW, a typical performance optimization (not done automatically by python) is to hoist unchanging-value

Re: question about the id()

2005-05-17 Thread Peter Dembinski
Giovanni Bajo [EMAIL PROTECTED] writes: Peter Dembinski wrote: BTW, a typical performance optimization (not done automatically by python) is to hoist unchanging-value expressions out of loops, and obj.method is often such an expression, so you will this strategy when people try to squeeze

Re: speeding up Python script

2005-05-18 Thread Peter Dembinski
Luis P. Mendes [EMAIL PROTECTED] writes: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have a 1000 line python script that takes many hours to finish. It is running with six inside 'for' loops. I've searched the net for ways to speed up the proccess. Psyco improves performance

Re: How to learn OO of python?

2005-05-18 Thread Peter Dembinski
could ildg [EMAIL PROTECTED] writes: I have learned python for over a month. I heard that it was very easy to learn, but when I tried to know OO of python, I found it really weird, some expressions seem very hard to understand, and I can't find enough doc to know any more about it. These

Re: Is Python suitable for a huge, enterprise size app?

2005-05-18 Thread Peter Dembinski
keirr [EMAIL PROTECTED] writes: [snap] I wouldn't, especially[1] if your thousands of business objects get allocated/deallocated as the system runs. Currently python's memory usage can grow rapidly (from the perspective of the o/s) when large numbers of objects are repeatedly created and

Re: Access lotus notes using Python

2005-05-23 Thread Peter Dembinski
Sateesh [EMAIL PROTECTED] writes: Hi, Is it possible to access Lotus notes using Python? Can anyone provide me some pointers? jython + LN Java bindings may be usable -- http://www.peter.dembinski.prv.pl -- http://mail.python.org/mailman/listinfo/python-list

Re: What are OOP's Jargons and Complexities?

2005-05-23 Thread Peter Dembinski
Xah Lee [EMAIL PROTECTED] writes: [snap] put it on your blog -- http://www.peter.dembinski.prv.pl -- http://mail.python.org/mailman/listinfo/python-list