Re: Aggressive language on python-list

2012-10-16 Thread rusi
and sane; unfortunately covered in the 'dog-pile' of all the rest. Hopefully he will put in his word here as well. [And Zero thank you for starting this thread] Rusi - http://blog.languager.org -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehension question

2012-10-16 Thread rusi
On Oct 17, 7:14 am, Dave Angel d...@davea.name wrote: On 10/16/2012 09:54 PM, Kevin Anthony wrote: I've been teaching myself list comprehension, and i've run across something i'm not able to convert. here's the original code for matrix multiplcation retmatrix =

Re: Aggressive language on python-list

2012-10-16 Thread rusi
On Oct 17, 9:25 am, alex23 wuwe...@gmail.com wrote: On Oct 17, 1:54 pm, Kristen J. Webb kw...@teradactyl.com wrote: It sucks for me to spend so much time filtering this BS. Yet you then chose to participate in a discussion about it. Because that's what people do to discuss suitable

Re: how to insert random error in a programming

2012-10-15 Thread rusi
On Oct 15, 9:00 pm, John Gordon gor...@panix.com wrote: In mailman.2205.1350309347.27098.python-l...@python.org Debashish Saha silid...@gmail.com writes: how to insert random error in a programming? Open the program source file and replace the Nth character with a random character. I'm

Re: Basic JSON question: Do I really need the quotes

2012-10-12 Thread rusi
On Oct 13, 5:03 am, Roy Smith r...@panix.com wrote: In article cbd2f125-38ca-4f46-9077-95de0cf7e...@googlegroups.com,  moo...@yahoo.co.uk wrote: I need to define some configuration in a file that will be manually created. [...] json seemed a quick an easy way of achieving this JSON

Re: Insert item before each element of a list

2012-10-08 Thread rusi
On Oct 9, 7:06 am, Roy Smith r...@panix.com wrote: In article mailman.1976.1349747963.27098.python-l...@python.org,  Terry Reedy tjre...@udel.edu wrote: On 10/8/2012 3:28 PM, mooremath...@gmail.com wrote: What's the best way to accomplish this?  Am I over-complicating it?  My

Re: Insert item before each element of a list

2012-10-08 Thread rusi
On Oct 9, 7:34 am, rusi rustompm...@gmail.com wrote: How about a 2-paren version? x = [1,2,3] reduce(operator.add,  [['insert', a] for a in x]) ['insert', 1, 'insert', 2, 'insert', 3] Or if one prefers the different parens on the other side: reduce(operator.add, (['insert

Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread rusi
On Oct 7, 9:15 am, Ramchandra Apte maniandra...@gmail.com wrote: On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens  wrote: I am currently starting my PhD in software quality assurance and have been doing a lot of reading round this subject. I am just trying to find out if there is

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread rusi
On Sep 30, 5:58 pm, tcgo tomeu...@gmail.com wrote: Hi! I'm really new to Usenet/Newsgroups, but... I'd like to learn some new programming language, because I learnt a bit of Perl though its OOP is ugly. So, after searching a bit, I found Python and Ruby, and both of they are cute. So,

Re: Stop feeding the trolls (Was: which a is used?)

2012-09-28 Thread rusi
On Sep 28, 10:21 am, Dwight Hutto dwightdhu...@gmail.com wrote: On Fri, Sep 28, 2012 at 1:12 AM, Littlefield, Tyler ty...@tysdomain.com wrote: On 9/27/2012 10:50 PM, Dwight Hutto wrote: On Fri, Sep 28, 2012 at 12:40 AM, Chris Angelico ros...@gmail.com wrote: On Fri, Sep 28, 2012 at 1:47

Re: Article on the future of Python

2012-09-28 Thread rusi
On Sep 27, 5:11 pm, Devin Jeanpierre jeanpierr...@gmail.com wrote: On Thu, Sep 27, 2012 at 2:13 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 25 Sep 2012 09:15:00 +0100, Mark Lawrence wrote: And a response: http://data.geek.nz/python-is-doing-just-fine Summary

Re: Article on the future of Python

2012-09-28 Thread rusi
On Sep 28, 5:54 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Fri, 28 Sep 2012 05:08:24 -0700, rusi wrote: On Sep 27, 5:11 pm, Devin Jeanpierre jeanpierr...@gmail.com wrote: On Thu, Sep 27, 2012 at 2:13 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote

Re: Bitshifts and And vs Floor-division and Modular

2012-09-07 Thread rusi
On Sep 7, 9:32 am, Paul Rubin no.em...@nospam.invalid wrote: rusi rustompm...@gmail.com writes: On an 8086/8088 a MUL (multiply) instruction was of the order of 100 clocks ...  On most modern processors (after the pentium) the difference has mostly vanished.  I cant find a good data sheet

Re: Bitshifts and And vs Floor-division and Modular

2012-09-06 Thread rusi
On Sep 7, 5:01 am, jimbo1qaz jimmyli1...@gmail.com wrote: Is it faster to use bitshifts or floor division? And which is better, or %? All divisors and mods are power of 2, so are binary operations faster? And are they considered bad style? On an 8086/8088 a MUL (multiply) instruction was of

Re: How to tell people to ask questions the smart way

2012-09-04 Thread rusi
On Sep 5, 4:27 am, Mark Lawrence breamore...@yahoo.co.uk wrote: On 05/09/2012 00:05, Ben Finney wrote: Andreas Perstinger andiper...@gmail.com writes: On 04.09.2012 11:34, Paolo wrote: how do I know if a JTextField has the focus? thank to all Look there:

Re: Flexible string representation, unicode, typography, ...

2012-08-28 Thread rusi
On Aug 28, 4:57 am, Neil Hodgson nhodg...@iinet.net.au wrote: wxjmfa...@gmail.com: Go has the integers int32 and int64. A rune ensure the usage of int32. Text libs use runes. Go has only bytes and runes.      Go's text libraries use UTF-8 encoded byte strings. Not arrays of runes. See,

Re: Data cleaning workouts

2012-08-24 Thread rusi
On Aug 23, 12:52 pm, Fg Nu fgn...@yahoo.com wrote: List folk, I am a newbie trying to get used to Python. I was wondering if anyone knows of web resources that teach good practices in data cleaning and management for statistics/analytics/machine learning, particularly using Python.

Re: Top-posting c.

2012-08-24 Thread rusi
On Aug 24, 7:23 pm, Ramchandra Apte maniandra...@gmail.com wrote: As BFDL, I hereby command everybody to stop the discussion. lets put time on useful stuff i am using google groups (i think it knows what to do) Your posts are coming in doubles. And the quoted lines are coming double-spaced!

Re: Flexible string representation, unicode, typography, ...

2012-08-24 Thread rusi
On Aug 24, 12:22 am, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Aug 23, 2012 at 12:33 PM,  wxjmfa...@gmail.com wrote: sys.getsizeof('a' * 80 * 50) 4025 sys.getsizeof('a' * 80 * 50 + '•') 8040     This example is still benefiting from shrinking the number of bytes in half

Re: Looking for duplicate modules

2012-08-24 Thread rusi
On Aug 23, 8:30 pm, Roy Smith r...@panix.com wrote: We got burned yesterday by a scenario which has burned us before.  We had multiple copies of a module in sys.path.  One (the one we wanted) was in our deployed code tree, the other was in /usr/local/lib/python/ or some such.  It was a

Re: Top-posting c.

2012-08-24 Thread rusi
On Aug 24, 8:58 pm, rusi rustompm...@gmail.com wrote: On Aug 24, 7:23 pm, Ramchandra Apte maniandra...@gmail.com wrote: As BFDL, I hereby command everybody to stop the discussion. lets put time on useful stuff i am using google groups (i think it knows what to do) Your posts are coming

Re: Objects in Python

2012-08-23 Thread rusi
On Aug 23, 9:34 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Wed, 22 Aug 2012 18:46:43 +0100, lipska the kat wrote: We need to separate out the 'view' from the 'implementation' here. Most developers I know, if looking at the code and without the possibly dubious

Re: Guarding arithmetic

2012-08-23 Thread rusi
On Aug 23, 3:11 pm, Peter Otten __pete...@web.de wrote: Mark Carter wrote: Suppose I want to define a function safe, which returns the argument passed if there is no error, and 42 if there is one. So the setup is something like: def safe(x):    # WHAT WOULD DEFINE HERE? print

Re: How do I display unicode value stored in a string variable using ord()

2012-08-20 Thread rusi
On Aug 19, 11:11 pm, wxjmfa...@gmail.com wrote: Le dimanche 19 août 2012 19:48:06 UTC+2, Paul Rubin a écrit : But they are not ascii pages, they are (as stated) MOSTLY ascii. E.g. the characters are 99% ascii but 1% non-ascii, so 393 chooses a much more memory-expensive encoding than

Re: Top-posting c. (was Re: [ANNC] pybotwar-0.8)

2012-08-20 Thread rusi
On Aug 19, 12:15 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: is probably a really great person and kind to small animals and furry children, but... ROFL! The first we're all familiar with. Furry children? Something to do with heads the size of a planet? --

Re: Top-posting c. (was Re: [ANNC] pybotwar-0.8)

2012-08-18 Thread rusi
On Aug 18, 8:34 pm, Grant Edwards inva...@invalid.invalid wrote: On 2012-08-17, rusi rustompm...@gmail.com wrote: I was in a corporate environment for a while.  And carried my 'triminterleave' habits there. And got gently scolded for seeming to hide things!! I have, rarely, gotten

Re: How do I display unicode value stored in a string variable using ord()

2012-08-18 Thread rusi
On Aug 18, 10:59 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Sat, 18 Aug 2012 08:07:05 -0700, wxjmfauth wrote: Is there any reason why non ascii users are somehow penalized compared to ascii users? Of course there is a reason. If you want to represent 1114111

Re: Top-posting c. (was Re: [ANNC] pybotwar-0.8)

2012-08-17 Thread rusi
On Aug 17, 3:36 am, Chris Angelico ros...@gmail.com wrote: On Fri, Aug 17, 2012 at 1:40 AM, Ramchandra Apte maniandra...@gmail.com wrote: On 16 August 2012 21:00, Mark Lawrence breamore...@yahoo.co.uk wrote: and bottom reads better than top Look you are the only person complaining about

Re: remote read eval print loop

2012-08-17 Thread rusi
On Aug 17, 12:25 pm, Chris Angelico ros...@gmail.com wrote: On Fri, Aug 17, 2012 at 12:27 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: There is already awesome protocols for running Python code remotely over a network. Please do not re-invent the wheel without good

Re: Top-posting c. (was Re: [ANNC] pybotwar-0.8)

2012-08-17 Thread rusi
On Aug 17, 10:19 am, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Thu, 16 Aug 2012 15:42:54 -0700 (PDT), Madison May worldpeaceagentforcha...@gmail.com declaimed the following in gmane.comp.python.general: As a lurker, I agree completely with Chris's sentiments.         I've been

Re: save dictionary to a file without brackets.

2012-08-13 Thread rusi
On Aug 13, 1:05 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Chill out Alex, it's all good. Mark was channelling a famous scene from Fawlty Towers, staring Monty Python's own John Cleese, hence it is on- topic, for the sillier definitions of on-topic. Ha! Thanks for that

Re: Looking for a good introduction to object oriented programming with Python

2012-08-08 Thread rusi
On Aug 8, 2:51 pm, lipska the kat lipskathe...@yahoo.co.uk wrote: The point I'm obviously struggling to make is that words convey concepts The word Person conveys a whole lifetime of experience of People and as imperfect human beings many of us are unable to tease out 'bits of being a person'

Re: Looking for a good introduction to object oriented programming with Python

2012-08-07 Thread rusi
On Aug 7, 7:34 pm, lipska the kat lipskathe...@yahoo.co.uk wrote: Never thought so for a moment, good to know you can be reasonable as well as misguided ;-) Well Lipska I must say that I find something resonant about the 'no- person' thing, though I am not sure what. You also said something

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread rusi
On Aug 6, 12:46 am, lipska the kat lipskathe...@yahoo.co.uk wrote: On 04/08/12 16:49, Jean Dubois wrote: I'm looking for a good introduction to object oriented programming with Python. Object Oriented programming is a mindset, a way of looking at that particular part of our world that

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread rusi
On Aug 6, 7:27 pm, lipska the kat lipskathe...@yahoo.co.uk wrote: You take out the garbage. I've got automatic garbage collection :-) BTW in automatic garbage collection which of the three words is most important? Least? Heres another take on nouns (and therefore OO):

Re: Intermediate Python user needed help

2012-08-06 Thread rusi
On Aug 7, 6:16 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Mon, 06 Aug 2012 09:05:50 -0700, Ethan Furman wrote:   These are not the errors an intermediate user would make, nor the questions an intermediate user would ask.  These are the errors that somebody who

Re: The way to develope a graphical application to manage a Postgres database

2012-08-06 Thread rusi
On Aug 5, 11:26 pm, Csanyi Pal csanyi...@gmail.com wrote: Mark Lawrence breamore...@yahoo.co.uk writes: On 05/08/2012 16:58, Csanyi Pal wrote: Walter Hurry walterhu...@lavabit.com writes: On Thu, 02 Aug 2012 20:24:36 +0200, Csanyi Pal wrote: I'm searching for a way to develope a Python

Alternate Python extensions (was alternate Python implementations)

2012-08-06 Thread rusi
On Aug 4, 11:15 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Most people are aware, if only vaguely, of the big Four Python implementations: I think the question about where Cython fits into this, raises the need for a complementary list to Steven's. What are the different

Re: Intermediate Python user needed help

2012-08-06 Thread rusi
On Aug 7, 8:06 am, Jugurtha Hadjar jugurtha.had...@gmail.com wrote: On 08/05/2012 09:52 PM, John Mordecai Dildy wrote: NameError: name 'start' is not defined anyone know how to make start defined Maybe rename it defined_start ;) I wonder how someone can get to the point of writing more

Re: Eclipse and the Python plugin

2012-08-03 Thread rusi
On Aug 3, 4:34 pm, lipska the kat lipskathe...@yahoo.co.uk wrote: A while ago someone asked me what I thought of the Eclipse plugin for python, well I just downloaded and installed the latest version of Eclipse for Java (Juno) followed by the Python plugin. Thanks Lipska for reporting back. I

Re: Eclipse and the Python plugin

2012-08-03 Thread rusi
On Aug 3, 10:04 pm, lipska the kat lipskathe...@yahoo.co.uk wrote: 117 methods seems a lot doesn't it. I'm still trying to get my head around Python packages, I think Eclipse will help me with this and the whole module mix of functions and classes is taking a while to get used to. The

Re: Is Python a commercial proposition ?

2012-07-30 Thread rusi
On Jul 29, 9:01 pm, lipska the kat lip...@yahoo.co.uk wrote: Pythoners Firstly, thanks to those on the tutor list who answered my questions. I'm trying to understand where Python fits into the set of commonly available, commercially used languages of the moment. My most recent experience

Re: OT: Text editors

2012-07-28 Thread rusi
On Jul 29, 10:08 am, Ben Finney ben+pyt...@benfinney.id.au wrote: Tim Chase python.l...@tim.thechases.com writes: On Sat, Jul 28, 2012 at 6:29 PM, Mark Lawrence wrote: I highly recommend the use of notepad++.  If anyone knows of a better text editor for Windows please let me know :) I

Re: from future import pass_function

2012-07-26 Thread rusi
On Jul 25, 1:40 pm, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Hi! I just had an idea, it occurred to me that the pass statement is pretty similar to the print statement, and similarly to the print() function, there could be a pass() function that does and returns nothing.

Re: from future import pass_function

2012-07-25 Thread Rusi
Ulrich: If you take a look at pep 3105 you find five rationales. http://www.python.org/dev/peps/pep-3105/#rationale If the first were the only one then your suggestion would have merit. There are also the other 4 in which pass and print dont really correspond. Steven wrote earlier: I have an

Re: Gender, Representativeness and Reputation in StackOverflow

2012-07-24 Thread rusi
On Mon, 23 Jul 2012 22:51:07 -0400, Devin Jeanpierre wrote: When people boycott a product, it isn't because not having the product is better than having the product. That's clearly untrue: despite the reasons for the boycott, the product has some value. They boycott it because by doing

Re: Using Python packaging tools to maintain source distributions in other languages?

2012-07-24 Thread rusi
On Jul 23, 11:16 pm, eric.lemi...@gmail.com wrote: Greetings all, I would like to leverage the Python packaging tools (e.g. distutils, setuptools, distribute, et. al.) to maintain (i.e. download, extract, configure, make, install, package) source distributions other than Python modules

Re: Using Python packaging tools to maintain source distributions in other languages?

2012-07-24 Thread Rusi
On Jul 25, 2:25 am, eric.lemi...@gmail.com wrote: On Monday, July 23, 2012 11:59:10 PM UTC-6, Rusi wrote: Ive heard good things about scons http://en.wikipedia.org/wiki/SCons I've heard about SCons but don't know much about it.  From what little I've read, it's only a make tool replacement

Re: Converting a list of strings into a list of integers?

2012-07-23 Thread rusi
On Jul 23, 7:27 pm, Grant Edwards inva...@invalid.invalid wrote: That said, map seems to be frowned upon by the Python community for reasons I've never really understood,... Maybe the analogy: comprehension : map:: relational calculus : relational algebra In particular map, filter

Freedom and Data (was Gender, Representativeness and Reputation in StackOverflow)

2012-07-23 Thread rusi
On Jul 24, 7:51 am, Devin Jeanpierre jeanpierr...@gmail.com wrote: On Mon, Jul 23, 2012 at 9:30 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Leaving aside the point that this is not directly related to Python, my opinion is that if the authors will not make past and

Re: Freedom and Data (was Gender, Representativeness and Reputation in StackOverflow)

2012-07-23 Thread rusi
On Jul 24, 9:28 am, Chris Angelico ros...@gmail.com wrote: On Tue, Jul 24, 2012 at 1:56 PM, rusi rustompm...@gmail.com wrote: How many of you use Linux? I ask. The awkwardness is in the definition of the question. Many of the products that I buy will have, at some point, been carried

Re: My first ever Python program, comments welcome

2012-07-23 Thread rusi
On Jul 22, 10:23 pm, Lipska the Kat lip...@lipskathekat.com wrote: Heh heh, Nothing to do with Eclipse, just another thing to get my head around. For work and Java IMHO you can't beat eclipse... at the moment I'm getting my head around git, Bumped into this yesterday. Seems like a good aid to

Re: My first ever Python program, comments welcome

2012-07-22 Thread rusi
On Jul 22, 2:20 pm, Lipska the Kat lip...@lipskathekat.com wrote: Well I have to say that I've used Eclipse with the myEclipse plugin for a number of years now and although it has it's moments it has earned me LOADS of MONEY so I can't really criticise it. Ive probably tried to use eclipse

Re: My first ever Python program, comments welcome

2012-07-21 Thread rusi
On Jul 22, 1:10 am, Dave Angel d...@davea.name wrote: A totally off-the-wall query.  Are you using a source control system, such as git ?  It can make you much braver about refactoring a working program. Question in a similar vein: What development environment do you use? My impression is

Re: can someone teach me this?

2012-07-20 Thread rusi
On Jul 21, 7:09 am, Menghsiu Lee menghsiu@gmail.com wrote: can someone teach me this? Lesson 1: Use an informational subject line Lesson 2: Post what you did and what happened -- http://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread rusi
On Jul 19, 6:34 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Wed, 18 Jul 2012 15:40:00 +0100, Lipska the Kat wrote: Object Oriented programming is all about encapsulating human concepts in a way that makes sense to human beings. Make no mistake, it is NEVER the case

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread rusi
language is just plain misleading. On 19/07/12 07:09, rusi wrote: In layman-speak and object is well, a thing. But we are not talking in 'layman-speak' we are discussing concepts that are familiar to us in the 'language of the domain' at least I though we were. And one of the most pervasive

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread rusi
On Jul 18, 5:46 am, Andrew Cooper am...@cam.ac.uk wrote: On 17/07/2012 19:36, Lipska the Kat wrote: On 17/07/12 19:18, Mark Lawrence wrote: On 17/07/2012 18:29, Ethan Furman wrote: Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: Well 'type-bondage' is a strange

Re: Implicit conversion to boolean in if and while statements

2012-07-16 Thread rusi
On Jul 15, 9:50 pm, Rick Johnson rantingrickjohn...@gmail.com wrote: On Sunday, July 15, 2012 11:19:16 AM UTC-5, Ian wrote: On Sun, Jul 15, 2012 at 4:56 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: (For the record, I can only think of one trap for the unwary: time

Re: Simulation Results Managment

2012-07-15 Thread rusi
On Jul 15, 11:35 am, Dieter Maurer die...@handshake.de wrote: moo...@yahoo.co.uk writes: ... Does pickle have any advantages over json/yaml? It can store and retrieve almost any Python object with almost no effort. Up to you whether you see it as an advantage to be able to store objects

Re: Python and Qt4 Designer

2012-07-14 Thread rusi
On Jul 14, 7:45 pm, Michael Torrie torr...@gmail.com wrote: On 07/13/2012 03:12 PM, Jean Dubois wrote: Thanks for the extra docu references In this day and age, I think compiling ui files to code is probably on the way out.  Instead you should consider using the ui files directly in your

Re: Simulation Results Managment

2012-07-14 Thread rusi
On Jul 14, 10:50 am, moo...@yahoo.co.uk wrote: Hi, This is a general question, loosely related to python since it will be the implementation language. I would like some suggestions as to manage simulation results data from my ASIC design. For my design, - I have a number of simulations

Re: lambda in list comprehension acting funny

2012-07-13 Thread rusi
On Jul 13, 11:36 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Thu, 12 Jul 2012 21:33:40 -0700, rusi wrote: On Jul 11, 11:41 am, Daniel Fetchinson fetchin...@googlemail.com wrote: funcs = [ lambda x: x**i for i in range( 5 ) ] print funcs[0]( 2 ) print funcs[1]( 2

Re: lambda in list comprehension acting funny

2012-07-13 Thread rusi
To come back to the OPs question. Variables can be assigned. Or they can be bound. [C++ programmers will be familiar with the difference between initialization and assignment] List comprehensions are defined in terms of assignment to the local variable rather than binding. Hence the issue.

Re: code review

2012-07-13 Thread rusi
On Jul 13, 8:36 pm, Chris Angelico ros...@gmail.com wrote: On Sat, Jul 14, 2012 at 1:04 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Actually, no. Is True less than False, or is it greater? In boolean algebra, the question has no answer. It is only an implementation

Re: lambda in list comprehension acting funny

2012-07-13 Thread rusi
On Jul 13, 9:12 pm, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: VERBOSE = True def function(arg):     if VERBOSE:        print(calling function with arg %r % arg)     process(arg) def caller():     VERBOSE = False     function(1)

Re: lambda in list comprehension acting funny

2012-07-13 Thread rusi
On Jul 13, 10:53 pm, Hans Mulder han...@xs4all.nl wrote: If you add `global VERBOSE` to `caller`, then there is only one variable named `VERBOSE` and what `function` does, depends on the most recent assignment to that variable. If you remove your `global VERBOSE`, then there are two

Re: lambda in list comprehension acting funny

2012-07-13 Thread rusi
On Jul 14, 8:43 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Fri, 13 Jul 2012 19:31:24 -0700, rusi wrote: Consider the following def foo(x):     i = 100     if x:         j = [i for i in range(10)]         return i     else:         return i A simpler

Re: lambda in list comprehension acting funny

2012-07-12 Thread rusi
On Jul 11, 11:41 am, Daniel Fetchinson fetchin...@googlemail.com wrote: funcs = [ lambda x: x**i for i in range( 5 ) ] print funcs[0]( 2 ) print funcs[1]( 2 ) print funcs[2]( 2 ) This gives me 16 16 16 When I was excepting 1 2 4 Does anyone know why? Cheers, Daniel Your

Re: Python Interview Questions

2012-07-10 Thread rusi
On Jul 10, 4:40 am, Roy Smith r...@panix.com wrote: In article mailman.1965.1341876813.4697.python-l...@python.org,  Christian Heimes li...@cheimes.de wrote: Am 09.07.2012 23:22, schrieb Peter: One of my favourite questions when interviewing - and it was 100% reliable :-) - what are

Re: Python Interview Questions

2012-07-10 Thread rusi
On Jul 10, 12:33 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: This is why I hate job interviews. You have like 30 minutes, or even as little as 30 seconds, to make a good impression on somebody who may or may not be capable of telling the difference between a cheese sandwich

Re: code review

2012-07-04 Thread rusi
On Jul 4, 11:17 am, alex23 wuwe...@gmail.com wrote: On Jul 4, 3:39 pm, Littlefield, Tyler ty...@tysdomain.com wrote: I basically just stopped after a while. It got into a my language is better than your language, so I didn't see much constructive info. To be fair, it's more my vision of

Re: code review

2012-07-02 Thread rusi
On Jul 3, 7:25 am, John O'Hagan resea...@johnohagan.com wrote: I agree to some extent, but as a counter-example, when I was a child there a subject called Weights and Measures which is now redundant because of the Metric system. I don't miss hogsheads and fathoms at all. Music is another

Re: IPython 0.13 is officially out!

2012-07-01 Thread rusi
On Jul 1, 9:03 pm, Dave Cook davec...@nowhere.net wrote: On 2012-07-01, Virgil Stokes v...@it.uu.se wrote: I have tried to update 0.12 in Ubuntu 12.04 but as of now it can not find 0.13. Any suggestions on how to get it into Ubuntu 12.04 would be appreciated. Install pip and use it to

Re: code review

2012-06-30 Thread rusi
On Jul 1, 3:05 am, Thomas Jollans t...@jollybox.de wrote: Yes. My sole point, really, is that normally, one would expect these two expressions to be equivalent: a b c (a b) c This is clearly not true. That's the inconsistency here I dont see the inconsistency with the specific

Re: code review

2012-06-30 Thread rusi
On Jul 1, 8:23 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Sun, 01 Jul 2012 10:37:05 +1000, Chris Angelico wrote: On Sun, Jul 1, 2012 at 10:08 AM, Ben Finney ben+pyt...@benfinney.id.au wrote: Thomas Jollans t...@jollybox.de writes: My sole point, really, is that

Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-29 Thread rusi
On Jun 10, 3:36 pm, Arnaud Delobelle arno...@gmail.com wrote: On 10 June 2012 07:16, rusi rustompm...@gmail.com wrote: This is worth a read in this context:http://osteele.com/archives/2004/11/ides Interesting! I definitely fall nicely at one extreme of this dichotomy.  Every time I've

Re: Recommend decent Computer Science books

2012-06-27 Thread rusi
On Jun 28, 2:00 am, David Thomas dthoma...@me.com wrote: Hi I know that this is a group about Python.  But I am just wondering if anybody can recommend any introductory/good books on Conputer Science. Kind regards This is like asking: How do I live my life? or make money (or love)? etc Not

Re: emded revision control in Python application?

2012-06-22 Thread rusi
On Jun 22, 8:58 pm, duncan smith buzz...@urubu.freeserve.co.uk wrote: Hello,        I have an application that would benefit from collaborative working. Over time users construct a data environment which is a number of files in JSON format contained in a few directories (in the future I'll

Re: which one do you prefer? python with C# or java?

2012-06-12 Thread rusi
On Jun 12, 3:19 am, Matej Cepl mc...@redhat.com wrote: On 11/06/12 06:20, rusi wrote: Hi Matěj! If this question is politically incorrect please forgive me. Do you speak only one (natural) language -- English? And if this set is plural is your power of expression identical in each

Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-10 Thread rusi
On Jun 9, 10:07 pm, Dietmar Schwertberger n...@schwertberger.de wrote: And you can than go in the code editor to that function and change the code to do whatever you want. Having to go there is already more work than I would expect. I would expect to go there e.g. by a double-click. This

Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-10 Thread rusi
On Jun 10, 4:52 pm, Dietmar Schwertberger n...@schwertberger.de wrote: Am 10.06.2012 08:16, schrieb rusi: This is worth a read in this context:http://osteele.com/archives/2004/11/ides I've read the article. It presents some nice ideas, but probably the author has not used Python before

Re: which one do you prefer? python with C# or java?

2012-06-10 Thread rusi
On Jun 10, 6:40 pm, Matej Cepl mc...@redhat.com wrote: On 10/06/12 00:44, Yesterday Paid wrote: I'm planning to learn one more language with my python. Just my personal experience, but after passively learning many many languages, I came to the conclusion that I (and I suppose many others)

Re: Nexus Programming Language

2012-06-09 Thread rusi
On Jun 10, 7:46 am, Adam Campbell abcampbell...@gmail.com wrote: The Nexus programming language version 0.5.0 has been released. It is an object-oriented, dynamically-typed, reflective programming language, drawing from Lua and Ruby.www.nexuslang.org What does nexus have that python doesn't?

python for android anyone?

2012-05-28 Thread rusi
Ive been wanting to try the sl4a for a new android phone Ive got hold of as spelt out at http://www.linuxjournal.com/article/10940 Has anyone any experience/dos/donts for this? I am writing this while the update of the android sdk is happening and its taking forever. So just wondering if its

Re: python for android anyone?

2012-05-28 Thread rusi
On May 28, 9:13 pm, Paul Rubin no.em...@nospam.invalid wrote: rusi rustompm...@gmail.com writes: Ive been wanting to try the sl4a for a new android phone Ive got hold of as spelt out at http://www.linuxjournal.com/article/10940 Has anyone any experience/dos/donts for this? One of my co

Re: escaping/encoding/formatting in python

2012-05-22 Thread rusi
On Apr 6, 10:13 am, Steve Howell showel...@yahoo.com wrote: On Apr 5, 9:59 pm,rusirustompm...@gmail.com wrote: On Apr 6, 6:56 am,SteveHowellshowel...@yahoo.com wrote: One of the biggest nuisances for programmers, just beneath date/time APIs in the pantheon of annoyances, is that we are

Re: Trouble splitting strings with consecutive delimiters

2012-05-02 Thread rusi
On May 1, 9:50 am, deuteros deute...@xrs.net wrote: I'm using regular expressions to split a string using multiple delimiters. But if two or more of my delimiters occur next to each other in the string, it puts an empty string in the resulting list. For example:         re.split(':|;|px',

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread rusi
On Apr 26, 4:42 pm, Adam Skutt ask...@gmail.com wrote: In a mathematical sense, you're saying that given f(x) = x+2, using f(x) is somehow more direct (whatever the hell that even means) than using 'x+2'.  That's just not true.  We freely and openly interchange them all the time doing

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread rusi
On Apr 26, 7:44 pm, Adam Skutt ask...@gmail.com wrote: On Apr 26, 10:18 am, rusi rustompm...@gmail.com wrote: On Apr 26, 4:42 pm, Adam Skutt ask...@gmail.com wrote: In a mathematical sense, you're saying that given f(x) = x+2, using f(x) is somehow more direct (whatever the hell

Re: why () is () and [] is [] work in other way?

2012-04-24 Thread rusi
On Apr 23, 9:34 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: is is never ill-defined. is always, without exception, returns True if the two operands are the same object, and False if they are not. This is literally the simplest operator in Python. Circular definition: In

Re: why () is () and [] is [] work in other way?

2012-04-24 Thread rusi
On Apr 24, 4:06 pm, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5- a470-7603bd3aa...@spamschutz.glglgl.de wrote: Am 24.04.2012 08:02 schrieb rusi: On Apr 23, 9:34 am, Steven D'Apranosteve +comp.lang.pyt...@pearwood.info  wrote: is is never ill-defined. is always, without exception, returns

Re: Python Gotcha's?

2012-04-16 Thread rusi
On Apr 16, 11:44 am, Bryan bryanjugglercryptograp...@yahoo.com wrote: Steven D'Aprano wrote: And how is that different from any other two versions of Python? Python 3.0, also known as “Python 3000” or “Py3K”, is the first ever *intentionally backwards incompatible* Python release. --GVR

Re: Newbie python questions...

2012-04-15 Thread rusi
On Apr 15, 7:47 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Sat, 14 Apr 2012 11:25:57 -0700, vmars316 wrote: win7HomePremium: Greetings, 1) I installed portablePython(pP) here: C:\Users\vmars\Python3  ?Does that look ok? Sure, why not? 2) I would like to

Re: Newbie python questions...

2012-04-15 Thread rusi
On Apr 14, 11:25 pm, vmars316 vmars...@gmail.com wrote: win7HomePremium: Greetings, 1) I installed portablePython(pP) here: C:\Users\vmars\Python3  ?Does that look ok? A brief look at portable python's website indicates that its meant for running off usb sticks (ie without installation) If

Re: python module development workflow

2012-04-12 Thread rusi
On Apr 11, 8:38 pm, Peng Yu pengyu...@gmail.com wrote: On Apr 11, 10:25 am, John Gordon gor...@panix.com wrote: In 2900f481-fbe9-4da3-a7ca-5485d1ceb...@m13g2000yqc.googlegroups.com Peng Yu pengyu...@gmail.com writes: It is confusing to me what the best workflow is for python module

Re: escaping/encoding/formatting in python

2012-04-06 Thread rusi
On Apr 6, 1:52 pm, Nobody nob...@nowhere.com wrote: On Thu, 05 Apr 2012 22:28:19 -0700, rusi wrote: All this mess would vanish if the string-literal-starter and ender were different. You still need an escape character in order to be able to embed an unbalanced end character. Tcl

Re: Python Gotcha's?

2012-04-06 Thread rusi
On Apr 6, 6:55 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Thu, 05 Apr 2012 21:28:01 -0700, rusi wrote: Are there languages (other than python) in which single and double quotes are equivalent? Classic REXX, CSS, JavaScript, Lua, Prolog, XPath, YAML, Modula-2, HTML

Re: Python Gotcha's?

2012-04-06 Thread rusi
On Apr 6, 7:18 pm, Grzegorz Staniak gstan...@gmail.com wrote: On 06.04.2012, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wroted: Are there languages (other than python) in which single and double quotes are equivalent? Classic REXX, CSS, JavaScript, Lua, Prolog, XPath, YAML,

Re: Python Gotcha's?

2012-04-06 Thread rusi
On Apr 6, 8:40 pm, André Malo ndpar...@gmail.com wrote: * Steven D'Aprano wrote: On Thu, 05 Apr 2012 23:08:11 +0200, André Malo wrote: * Steven D'Aprano wrote: For a 21st century programming language or data format to accept only one type of quotation mark as string delimiter is rather

<    2   3   4   5   6   7   8   9   10   >