Re: python vs perl performance test

2007-12-13 Thread Jakub Stolarski
On 13 Gru, 19:11, [EMAIL PROTECTED] wrote: There's got to be a simpler and more efficient way to do this. Can you help? Thanks, igor If all you need is the result here's simpler and more efficient code: from random import randrange sum = 100 * randrange(128) print Sum is , sum And the

Re: yet another indentation proposal

2007-08-20 Thread Jakub Stolarski
Why not just use comments and some filter. Just write # _{ at the beginning and # _} at the end. Then filter just before runing indenting with those control sequences? Then there's no need to change interpreter. -- http://mail.python.org/mailman/listinfo/python-list

Re: From D

2007-07-25 Thread Jakub Stolarski
On Jul 25, 1:08 am, Steven D'Aprano [EMAIL PROTECTED] wrote: Underscores in numerics are UGLY. Why not take a leaf out of implicit string concatenation and allow numeric literals to implicitly concatenate? Python already does: hello- world = hello-world Propose: 123 456 789 = 123456789

Re: Pythonic way for missing dict keys

2007-07-20 Thread Jakub Stolarski
Version 1 and 2 do different thing than version 3. The latter doesn't add value to dict. As it was mentioned before, use: 1 - if you expect that there's no key in dict 2 - if you expect that there is key in dict -- http://mail.python.org/mailman/listinfo/python-list

Re: Capturing and sending keys {Esperanto}

2007-06-25 Thread Jakub Stolarski
On Jun 25, 3:26 pm, AJK [EMAIL PROTECTED] wrote: Hello there! I've been googleing yet, and suppose it's hopeless to try, but better ask it... I want to write a program which turns Cx to , cx to et al WHILE TYPING. (i.e. converting Esperanto x-system to real hats, for those who know

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-14 Thread Jakub Stolarski
On May 13, 5:44 pm, Martin v. Löwis [EMAIL PROTECTED] wrote: - should non-ASCII identifiers be supported? why? No. It's good convention to stick with english. And if we stick with english, why we should need non-ASCII characters? Any non-ASCII character makes code less readable. We never know if

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-14 Thread Jakub Stolarski
On May 14, 9:49 pm, Méta-MCI [EMAIL PROTECTED] wrote: Hi! - should non-ASCII identifiers be supported? why? - would you use them if it was possible to do so? in what cases? Yes. JScript can use letters with accents in identifiers XML (1.1) can use letters with accents in tags C# can

Re: Simple integer comparison problem

2007-04-14 Thread Jakub Stolarski
On Apr 14, 5:19 pm, [EMAIL PROTECTED] wrote: Hi! I ran in problem with simple exercise. I'm trying to get program to return grade when given points but no matter what, I always get F. def grader(): print Insert points: points = raw_input(' ') int(points) if points

Re: function/method assigment

2007-04-13 Thread Jakub Stolarski
On Apr 13, 6:14 pm, [EMAIL PROTECTED] wrote: I have a confusion when I do some practice, the code and output are as following, def fun(): print 'In fun()' testfun = fun() In fun() print testfun None testfun2 = fun print testfun2 function fun at 0x00CC1270

Re: bool value 'False' no memory address?

2007-04-04 Thread Jakub Stolarski
On Apr 4, 12:36 pm, autin [EMAIL PROTECTED] wrote: such as:b = False id(b) Traceback (most recent call last): File stdin, line 1, in ? TypeError: 'bool' object is not callable --- how to desc it? b = False id(b) 135311308 python 2.4, FreeBSD 6.2 --

Re: PLY for standard library

2007-02-22 Thread Jakub Stolarski
in standard library that's OK. But I think that python needs some standard parsing tool. -- Jakub Stolarski -- http://mail.python.org/mailman/listinfo/python-list

Re: PLY for standard library

2007-02-21 Thread Jakub Stolarski
On 20 Lut, 19:29, Alan Isaac [EMAIL PROTECTED] wrote: If not, what module providing substantially similar functionality is? AFAIK there's no parser generator module in standard library. I would like to see PLY in standard library too. -- Jakub Stolarski -- http://mail.python.org/mailman

Re: Walking The Right Path

2007-01-08 Thread Jakub Stolarski
Tim Daneliuk napisal(a): Ah yes, moral philosophy and python all come together... Er, that is to day: Imagine you have this situation on a *nix filesystem: Symlink A: /foo - /usr/home Symlink B: /bar - /foo/username If I do this: import os print os.path.realpath(/bar) I get