Brython 2.0 (Python in the browser)

2014-02-16 Thread pierre . quentel
Hi, Brython (Browser Python) is an implementation of Python 3 in the browser. Its goal is to be able to write client-side programs in Python instead of Javascript, with code inside tags script type=text/python.../script. As opposed to solutions such as Pyjamas or Py2JS, the translation from

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Pat Johnson
This made me grin. ;) -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of list reference

2014-02-16 Thread Marko Rauhamaa
Marko Rauhamaa ma...@pacujo.net: Conceptually, the everything is a reference and the small/big distinction are equivalent (produce the same outcomes). The question is, which model is easier for a beginner to grasp. Case in point, if everything is a reference, how come: hello.__str__()

Re: Install python 2 and 3 in the wrong order

2014-02-16 Thread Nagy László Zsolt
I should emphasize that this is with the /same/ x.y version... Installing 3.3 when the previous was 3.2 won't overlay. Though I don't see anything in the ActiveState builds (which are all I've ever used) to handle the #! type selection of the desired version. Just got done

Re: Explanation of list reference

2014-02-16 Thread Ian Kelly
On Feb 16, 2014 1:11 AM, Marko Rauhamaa ma...@pacujo.net wrote: Marko Rauhamaa ma...@pacujo.net: Conceptually, the everything is a reference and the small/big distinction are equivalent (produce the same outcomes). The question is, which model is easier for a beginner to grasp. Case in

Re: Explanation of list reference

2014-02-16 Thread Ian Kelly
On Sun, Feb 16, 2014 at 1:28 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Feb 16, 2014 1:11 AM, Marko Rauhamaa ma...@pacujo.net wrote: Case in point, if everything is a reference, how come: hello.__str__() 'hello' 1.__str__() SyntaxError: invalid syntax You need

Re: Explanation of list reference

2014-02-16 Thread Jussi Piitulainen
Marko Rauhamaa ma...@pacujo.net writes: Marko Rauhamaa ma...@pacujo.net: Conceptually, the everything is a reference and the small/big distinction are equivalent (produce the same outcomes). The question is, which model is easier for a beginner to grasp. Case in point, if everything

Re: Explanation of list reference

2014-02-16 Thread Alan Bawden
Marko Rauhamaa ma...@pacujo.net writes: Case in point, if everything is a reference, how come: hello.__str__() 'hello' 1.__str__() SyntaxError: invalid syntax (1).__str__() '1' 1..__str__() '1.0' -- Alan Bawden --

Re: Explanation of list reference

2014-02-16 Thread Steven D'Aprano
On Sun, 16 Feb 2014 10:08:22 +0200, Marko Rauhamaa wrote: Case in point, if everything is a reference, how come: hello.__str__() 'hello' 1.__str__() SyntaxError: invalid syntax Because it is a syntax error, just like the parser tells you. When the parser sees 1. it expects

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Terry Reedy
On 2/16/2014 1:38 AM, Devin Jeanpierre wrote: On Sat, Feb 15, 2014 at 8:45 PM, Sam lightai...@gmail.com wrote: I would like to learn and try out functional programming (FP). I love Python and would like to use it to try FP. Some have advised me to use Haskell instead because Python is not a

Re: random.sample with large weighted sample-sets?

2014-02-16 Thread Terry Reedy
On 2/15/2014 11:41 PM, Tim Chase wrote: I'm not coming up with the right keywords to find what I'm hunting. I'd like to randomly sample a modestly compact list with weighted distributions, so I might have data = ( (apple, 20), (orange, 50), (grape, 30), ) If you

Re: Explanation of list reference

2014-02-16 Thread Chris Angelico
On Sun, Feb 16, 2014 at 7:40 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: There are three simple ways to get the effect that you want: py x = 1; x.__str__() # don't use a literal '1' py (1).__str__() # parenthesize the literal '1' py 1 .__str__() # offset it from the

Re: Explanation of list reference

2014-02-16 Thread Marko Rauhamaa
Ian Kelly ian.g.ke...@gmail.com: (1).__str__() '1' Fair enough. The syntactic awkwardness, then, explains why numbers don't have an evolved set of methods (unlike strings). Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of list reference

2014-02-16 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: On Sat, 15 Feb 2014 23:01:53 +0200, Marko Rauhamaa wrote: I demonstrated a situation where your claim: id(x) == id(y) implies x is y fails. My from-the-hip formulation can obviously be inaccurate, but I was hoping the point was

Re: Explanation of list reference

2014-02-16 Thread Chris Angelico
On Sun, Feb 16, 2014 at 9:52 PM, Marko Rauhamaa ma...@pacujo.net wrote: Ian Kelly ian.g.ke...@gmail.com: (1).__str__() '1' Fair enough. The syntactic awkwardness, then, explains why numbers don't have an evolved set of methods (unlike strings). No; it's more that numbers are more often

Re: Explanation of list reference

2014-02-16 Thread Steven D'Aprano
On Sun, 16 Feb 2014 12:52:58 +0200, Marko Rauhamaa wrote: Ian Kelly ian.g.ke...@gmail.com: (1).__str__() '1' Fair enough. The syntactic awkwardness, then, explains why numbers don't have an evolved set of methods (unlike strings). But numbers do have an evolved set of methods. py

Re: How to turn a package into something pip can install

2014-02-16 Thread Chris “Kwpolska” Warrick
On Sat, Feb 15, 2014 at 11:35 PM, Roy Smith r...@panix.com wrote: In article roy-8299b9.17014115022...@news.panix.com, Roy Smith r...@panix.com wrote: $ pip install --no-index --quiet --find-links packages metar==1.4.0 [snip] ValueError: unknown url type: packages The path to your

Re: decimal numbers

2014-02-16 Thread wxjmfauth
Without any warranty. def z(r): ... # r: int 0 ... t = log10(r) ... if t = 12.0: ... prefix = '' ... prefix2 = '' ... elif t = 9.0: ... prefix = 'giga' ... prefix2 = 'G' ... r = r / 1.0e9 ... elif t = 6.0: ... prefix = 'mega'

Re: inheriting a large python code base

2014-02-16 Thread Rita
when I do profiling is it possible to find out if I am spending a lot of time in type conversion? it seems I am not. Also, is it possible to predeclare a type in python? Similar to C: int i=0; On Sat, Feb 15, 2014 at 10:06 PM, Rustom Mody rustompm...@gmail.com wrote: On Sunday, February 16,

Re: Problem importing libraries installed with PIP in Eclipse

2014-02-16 Thread Renato
Em sexta-feira, 14 de fevereiro de 2014 01h30min05s UTC-2, Renato escreveu: Hi guys, I'm using Python 2.7.5 64 bits and I have a problem when importing libraries that were installed via PIP when importing them inside Eclipse (version 4.3.1). Outside Eclipse (directly in Python's shell)

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Mark Lawrence
On 16/02/2014 08:00, Pat Johnson wrote: This made me grin. ;) What did, using google groups? :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus

Re: How to turn a package into something pip can install

2014-02-16 Thread Chris Angelico
On Sun, Feb 16, 2014 at 11:18 PM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: On Sat, Feb 15, 2014 at 11:35 PM, Roy Smith r...@panix.com wrote: Maybe this is something which has changed in newer versions of pip? I've got 1.1 (and python 2.7.3). I'm pretty sure both of these are what

Re: inheriting a large python code base

2014-02-16 Thread Chris Angelico
On Sun, Feb 16, 2014 at 11:59 PM, Rita rmorgan...@gmail.com wrote: when I do profiling is it possible to find out if I am spending a lot of time in type conversion? it seems I am not. I would guess that you don't. But in Python, type conversion is like any other function call: value =

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Chris Angelico
On Mon, Feb 17, 2014 at 12:20 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 16/02/2014 08:00, Pat Johnson wrote: This made me grin. ;) What did, using google groups? :) Well! I've often seen context without a grin, thought Alice; but a grin without context! It's the most curious thing

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Rustom Mody
On Sunday, February 16, 2014 10:15:58 AM UTC+5:30, Sam wrote: I would like to learn and try out functional programming (FP). I love Python and would like to use it to try FP. Some have advised me to use Haskell instead because Python is not a good language for FP. I am sort of confused at

Puzzling PDF

2014-02-16 Thread F.R.
Hi all, Struggling to parse bank statements unavailable in sensible data-transfer formats, I use pdftotext, which solves part of the problem. The other day I encountered a strange thing, when one single figure out of many erroneously converted into letters. Adobe Reader displays the figure

Re: Explanation of list reference

2014-02-16 Thread Rustom Mody
On Saturday, February 15, 2014 7:14:39 PM UTC+5:30, Marko Rauhamaa wrote: Mark Lawrence: I have no interest in understanding object identity, I can write code quite happily without it. Luckily, what we are now debating is mostly terminology and points of view where the outcomes are

Re: random.sample with large weighted sample-sets?

2014-02-16 Thread Tim Chase
On 2014-02-16 04:12, Terry Reedy wrote: On 2/15/2014 11:41 PM, Tim Chase wrote: data = ( (apple, 20), (orange, 50), (grape, 30), ) To Ben, yes, this was just some sample data; the original gets built from an external (i.e., client-supplied, thus the need to

Re: How to turn a package into something pip can install

2014-02-16 Thread Roy Smith
In article mailman.7053.1392557013.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Sun, Feb 16, 2014 at 11:18 PM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: On Sat, Feb 15, 2014 at 11:35 PM, Roy Smith r...@panix.com wrote: Maybe this is something which

Re: random.sample with large weighted sample-sets?

2014-02-16 Thread Ned Batchelder
On 2/16/14 9:22 AM, Tim Chase wrote: 3) you meant to write (10, 'apple') rather than 0. With my original example code, a 0-probability shouldn't ever show up in the sampling, where it looks like it might when using this sample code. In my particular use case, I can limit/ensure that

Re: Problem importing libraries installed with PIP in Eclipse

2014-02-16 Thread Renato
It's solved now, oh my god I was so stupid! I created a package named pybrain for testing PyBrain module, so obviously when I tryed to import something from PyBrain library, Python would import all modules from this personal package I created. The problem was not being reproduced outside

Re: How to turn a package into something pip can install

2014-02-16 Thread Mark Lawrence
On 16/02/2014 14:25, Roy Smith wrote: We tend not to upgrade stuff unless there's a good reason to. You never know what will break (looking furtively in the direction of the Python 3.x mafiosi). Yeah, those really unpleasant, nasty, horrible mafiosi who have the audacity to point out that

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Ryan
Python*can* do functional programming, but, for learning, Haskell will work better. Sam lightai...@gmail.com wrote: I would like to learn and try out functional programming (FP). I love Python and would like to use it to try FP. Some have advised me to use Haskell instead because Python is not a

Re: How to turn a package into something pip can install

2014-02-16 Thread MRAB
On 2014-02-16 15:06, Mark Lawrence wrote: On 16/02/2014 14:25, Roy Smith wrote: We tend not to upgrade stuff unless there's a good reason to. You never know what will break (looking furtively in the direction of the Python 3.x mafiosi). Yeah, those really unpleasant, nasty, horrible

How to answer questions from newbies

2014-02-16 Thread Roy Smith
We get a lot of newbie questions on this list. People are eager to jump in and answer them (which is wonderful), but sometimes we get off on tangents about trivia and lose sight of the real question, and our audience. The particular one that set me off just now (I'm leaving off the names

Re: Puzzling PDF

2014-02-16 Thread Roy Smith
In article mailman.7056.1392559276.18130.python-l...@python.org, F.R. anthra.nor...@bluewin.ch wrote: Hi all, Struggling to parse bank statements unavailable in sensible data-transfer formats, I use pdftotext, which solves part of the problem. The other day I encountered a strange thing,

Re: How to turn a package into something pip can install

2014-02-16 Thread Mark Lawrence
On 16/02/2014 15:20, MRAB wrote: On 2014-02-16 15:06, Mark Lawrence wrote: On 16/02/2014 14:25, Roy Smith wrote: We tend not to upgrade stuff unless there's a good reason to. You never know what will break (looking furtively in the direction of the Python 3.x mafiosi). Yeah, those really

Re: How to answer questions from newbies

2014-02-16 Thread Rustom Mody
On Sunday, February 16, 2014 8:53:47 PM UTC+5:30, Roy Smith wrote: We get a lot of newbie questions on this list. People are eager to jump in and answer them (which is wonderful), but sometimes we get off on tangents about trivia and lose sight of the real question, and our audience. The

Re: random.sample with large weighted sample-sets?

2014-02-16 Thread duncan smith
On 16/02/14 05:08, Ben Finney wrote: Tim Chase python.l...@tim.thechases.com writes: I'm not coming up with the right keywords to find what I'm hunting. I'd like to randomly sample a modestly compact list with weighted distributions, so I might have data = ( (apple, 20), (orange,

Re: random.sample with large weighted sample-sets?

2014-02-16 Thread Peter Otten
Tim Chase wrote: On 2014-02-16 04:12, Terry Reedy wrote: On 2/15/2014 11:41 PM, Tim Chase wrote: data = ( (apple, 20), (orange, 50), (grape, 30), ) To Ben, yes, this was just some sample data; the original gets built from an external (i.e., client-supplied,

Re: How to answer questions from newbies

2014-02-16 Thread Roy Smith
In article c2078ca1-c85a-4795-8632-6b005436c...@googlegroups.com, Rustom Mody rustompm...@gmail.com wrote: On Sunday, February 16, 2014 8:53:47 PM UTC+5:30, Roy Smith wrote: We get a lot of newbie questions on this list. People are eager to jump in and answer them (which is wonderful),

Re: Explanation of list reference

2014-02-16 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: On Sun, 16 Feb 2014 12:52:58 +0200, Marko Rauhamaa wrote: The syntactic awkwardness, then, explains why numbers don't have an evolved set of methods (unlike strings). But numbers do have an evolved set of methods. [...] py from decimal

Re: Puzzling PDF

2014-02-16 Thread Emile van Sebille
You On 2/16/2014 6:00 AM, F.R. wrote: Hi all, Struggling to parse bank statements unavailable in sensible data-transfer formats, I use pdftotext, which solves part of the problem. The other day I encountered a strange thing, when one single figure out of many erroneously converted into letters.

Re: Explanation of list reference

2014-02-16 Thread Ned Batchelder
On 2/16/14 9:00 AM, Rustom Mody wrote: On Saturday, February 15, 2014 7:14:39 PM UTC+5:30, Marko Rauhamaa wrote: Mark Lawrence: I have no interest in understanding object identity, I can write code quite happily without it. Luckily, what we are now debating is mostly terminology and

Re: random.sample with large weighted sample-sets?

2014-02-16 Thread Charles Allen
How efficient does this thing need to be? You can always just turn it into a two-dimensional sampling problem by thinking of the data as a function f(x=item), generating a random x=xr in [0,x], then generating a random y in [0,max(f(x))]. The xr is accepted if 0 y = max(f(xr)), or rejected (and

Re: Explanation of list reference

2014-02-16 Thread Rustom Mody
On Sunday, February 16, 2014 9:59:53 PM UTC+5:30, Ned Batchelder wrote: On 2/16/14 9:00 AM, Rustom Mody wrote: On Saturday, February 15, 2014 7:14:39 PM UTC+5:30, Marko Rauhamaa wrote: Mark Lawrence: I have no interest in understanding object identity, I can write code quite happily

Re: random.sample with large weighted sample-sets?

2014-02-16 Thread duncan smith
On 16/02/14 16:35, Charles Allen wrote: How efficient does this thing need to be? You can always just turn it into a two-dimensional sampling problem by thinking of the data as a function f(x=item), generating a random x=xr in [0,x], then generating a random y in [0,max(f(x))]. The xr is

Re: Explanation of list reference

2014-02-16 Thread Marko Rauhamaa
Rustom Mody rustompm...@gmail.com: But for that Ive to use is And as a teacher Ive to explain is Might as well use C and get on with pointers To me 'is' is a can of worms I'm not against is, but it must be carefully defined and taught. As far as x is None is concerned, a key piece of

Re: Explanation of list reference

2014-02-16 Thread Mark Lawrence
On 16/02/2014 18:01, Marko Rauhamaa wrote: Rustom Mody rustompm...@gmail.com: But for that Ive to use is And as a teacher Ive to explain is Might as well use C and get on with pointers To me 'is' is a can of worms I'm not against is, but it must be carefully defined and taught. As far as x

Re: Puzzling PDF

2014-02-16 Thread Alister
On Sun, 16 Feb 2014 10:33:39 -0500, Roy Smith wrote: In article mailman.7056.1392559276.18130.python-l...@python.org, F.R. anthra.nor...@bluewin.ch wrote: Hi all, Struggling to parse bank statements unavailable in sensible data-transfer formats, I use pdftotext, which solves part of the

Re: Explanation of list reference

2014-02-16 Thread Alister
On Sat, 15 Feb 2014 10:44:39 +0100, Christian Gollwitzer wrote: Am 15.02.14 01:57, schrieb Chris Angelico: Can you give an example of an ambiguous case? Fundamentally, the 'is' operator tells you whether its two operands are exactly the same object, nothing more and nothing less, so I assume

Re: random.sample with large weighted sample-sets?

2014-02-16 Thread Terry Reedy
On 2/16/2014 9:22 AM, Tim Chase wrote: On 2014-02-16 04:12, Terry Reedy wrote: On 2/15/2014 11:41 PM, Tim Chase wrote: data = ( (apple, 20), (orange, 50), (grape, 30), ) If you actually start with date in this form, write the few lines needed to produce the form

Re: random.sample with large weighted sample-sets? [SOLVED]

2014-02-16 Thread Tim Chase
On 2014-02-16 14:47, Terry Reedy wrote: 2) the data has to be sorted for bisect to work cumulative sums are automatically sorted. Ah, that they were *cumulative* was the key that I missed in my understanding. It makes sense now and works like a charm. Thanks to all who offered a hand in

Re: Puzzling PDF

2014-02-16 Thread F.R.
On 02/16/2014 05:29 PM, Emile van Sebille wrote: You On 2/16/2014 6:00 AM, F.R. wrote: Hi all, Struggling to parse bank statements unavailable in sensible data-transfer formats, I use pdftotext, which solves part of the problem. The other day I encountered a strange thing, when one single

Re: Explanation of list reference

2014-02-16 Thread Gregory Ewing
Steven D'Aprano wrote: And indeed numpy arrays do share state. Why? No idea. Somebody thought that it was a good idea. (Not me though...) Probably because they're often large and people don't want to incur the overhead of copying them any more than necessary. So slices are defined to return

Re: Explanation of list reference

2014-02-16 Thread Gregory Ewing
Chris Angelico wrote: Because everything in Python is an object, and objects always are handled by their references. beginner_thought So, we have objects... and we have references to objects... but everything is an object... so does that mean references are objects too? /beginner_thought This

Re: Explanation of list reference

2014-02-16 Thread Chris Angelico
On Mon, Feb 17, 2014 at 9:54 AM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Chris Angelico wrote: Because everything in Python is an object, and objects always are handled by their references. beginner_thought So, we have objects... and we have references to objects... but everything

Re: Explanation of list reference

2014-02-16 Thread Ben Finney
Gregory Ewing greg.ew...@canterbury.ac.nz writes: Chris Angelico wrote: Because everything in Python is an object, and objects always are handled by their references. beginner_thought So, we have objects... and we have references to objects... but everything is an object... so does that

Re: Explanation of list reference

2014-02-16 Thread Roy Smith
In article mailman.7074.1392591962.18130.python-l...@python.org, Ben Finney ben+pyt...@benfinney.id.au wrote: Gregory Ewing greg.ew...@canterbury.ac.nz writes: Chris Angelico wrote: Because everything in Python is an object, and objects always are handled by their references.

Re: Explanation of list reference

2014-02-16 Thread Roy Smith
In article mailman.7073.1392591754.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Mon, Feb 17, 2014 at 9:54 AM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Chris Angelico wrote: Because everything in Python is an object, and objects always are handled by

Re: Explanation of list reference

2014-02-16 Thread Ben Finney
Roy Smith r...@panix.com writes: In article mailman.7074.1392591962.18130.python-l...@python.org, Ben Finney ben+pyt...@benfinney.id.au wrote: Gregory Ewing greg.ew...@canterbury.ac.nz writes: beginner_thought So, we have objects... and we have references to objects... but everything

Re: Explanation of list reference

2014-02-16 Thread Chris Angelico
On Mon, Feb 17, 2014 at 10:46 AM, Roy Smith r...@panix.com wrote: References aren't themselves objects. Names, attributes, etc, etc, etc, all refer to objects. Is it clearer to use the verb refer rather than the noun reference? ChrisA I know functions are objects, but what about statements?

Re: How to answer questions from newbies

2014-02-16 Thread Rustom Mody
On Sunday, February 16, 2014 9:44:00 PM UTC+5:30, Roy Smith wrote: Moi? See thats the problem with re's -- just 3 letters and completely incomprehensible! It even resembles our resident unicode-troll Oui? -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of list reference

2014-02-16 Thread Ned Batchelder
On 2/16/14 5:54 PM, Gregory Ewing wrote: Chris Angelico wrote: Because everything in Python is an object, and objects always are handled by their references. beginner_thought So, we have objects... and we have references to objects... but everything is an object... so does that mean

Re: How to answer questions from newbies

2014-02-16 Thread Ben Finney
Rustom Mody rustompm...@gmail.com writes: On Sunday, February 16, 2014 9:44:00 PM UTC+5:30, Roy Smith wrote: Moi? See thats the problem with re's -- just 3 letters and completely incomprehensible! Actually, that's a regexp pattern that matches two *or* three letters. -- \ “If

Re: Explanation of list reference

2014-02-16 Thread Chris Angelico
On Mon, Feb 17, 2014 at 12:43 PM, Ned Batchelder n...@nedbatchelder.com wrote: The correct statement is all values are objects, or all data is objects. When people mistakenly say everything is an object, they are implicitly only thinking about data. That said, all data is objects is really

Re: How to answer questions from newbies

2014-02-16 Thread Chris Angelico
On Mon, Feb 17, 2014 at 12:46 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Rustom Mody rustompm...@gmail.com writes: On Sunday, February 16, 2014 9:44:00 PM UTC+5:30, Roy Smith wrote: Moi? See thats the problem with re's -- just 3 letters and completely incomprehensible! Actually,

Re: Explanation of list reference

2014-02-16 Thread Roy Smith
In article mailman.7079.1392602374.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Mon, Feb 17, 2014 at 12:43 PM, Ned Batchelder n...@nedbatchelder.com wrote: The correct statement is all values are objects, or all data is objects. When people mistakenly say

Re: Possibly better stringobject allocator

2014-02-16 Thread anish198519851985
On Saturday, February 8, 1997 12:00:00 AM UTC-8, Guido van Rossum wrote: I installed modified versions of stringobject.c and stropmodule.c on our web server. They are accessible via http://www.automatrix.com/~skip/python/ Cool. I read your description and am very pleased with

Re: Explanation of list reference

2014-02-16 Thread Ben Finney
Roy Smith r...@panix.com writes: Chris Angelico ros...@gmail.com wrote: Part of the trouble is that some code is (represented by) objects. A function is an object, ergo it's data; a module is an object (though that's different); a class is an object; but no other block of code is.

Re: Explanation of list reference

2014-02-16 Thread Rustom Mody
On Monday, February 17, 2014 8:58:23 AM UTC+5:30, Roy Smith wrote: Chris Angelico wrote: The correct statement is all values are objects, or all data is objects. When people mistakenly say everything is an object, they are implicitly only thinking about data. That said, all data

Re: Explanation of list reference

2014-02-16 Thread Steven D'Aprano
On Sun, 16 Feb 2014 20:01:46 +0200, Marko Rauhamaa wrote: As far as x is None is concerned, a key piece of information is presented on URL: http://docs.python.org/3.2/library/constants.html: None The sole value of the type NoneType. Sole, adj. being the only one;

Re: Explanation of list reference

2014-02-16 Thread Steven D'Aprano
On Mon, 17 Feb 2014 11:40:57 +1300, Gregory Ewing wrote: Steven D'Aprano wrote: And indeed numpy arrays do share state. Why? No idea. Somebody thought that it was a good idea. (Not me though...) Probably because they're often large and people don't want to incur the overhead of copying

Python version problem for rpm

2014-02-16 Thread anju tiwari
Hi all, I have two version of python 2.4 and 2.7. By default python version is 2.4 . I want to install need to install some rpm which needs python 2.7 interpreter. how can I enable 2.7 interpreter for only those packages which are requiring python 2.7, I don't want to change my default python

Re: Explanation of list reference

2014-02-16 Thread Steven D'Aprano
On Mon, 17 Feb 2014 11:54:45 +1300, Gregory Ewing wrote: Chris Angelico wrote: Because everything in Python is an object, and objects always are handled by their references. beginner_thought So, we have objects... and we have references to objects... but everything is an object... so does

Re: Explanation of list reference

2014-02-16 Thread Steven D'Aprano
On Sun, 16 Feb 2014 18:43:15 -0500, Roy Smith wrote: In article mailman.7074.1392591962.18130.python-l...@python.org, Ben Finney ben+pyt...@benfinney.id.au wrote: Gregory Ewing greg.ew...@canterbury.ac.nz writes: Chris Angelico wrote: Because everything in Python is an object, and

select(sock) indicates not-ready, but sock.recv does not block

2014-02-16 Thread Nikolaus Rath
Hello, I have a problem with using select. I can reliably reproduce a situation where select.select((sock.fileno(),), (), (), 0) returns ((),(),()) (i.e., no data ready for reading), but an immediately following sock.recv() returns data without blocking. I am pretty sure that this is not a race

Re: Explanation of list reference

2014-02-16 Thread Chris Angelico
On Mon, Feb 17, 2014 at 5:21 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: So before you ask: for-loops aren't things (values). Neither are while- loops, try...except blocks, pass statements, del statements, etc. Nor are names and other references -- I believe that there is a

Re: select(sock) indicates not-ready, but sock.recv does not block

2014-02-16 Thread Chris Angelico
On Mon, Feb 17, 2014 at 5:35 PM, Nikolaus Rath nikol...@rath.org wrote: Hello, I have a problem with using select. I can reliably reproduce a situation ... Can you reproduce it with a reasonably short amount of code? If so, please post it. I'm running Python 3.3.3 under Linux 3.12. Do you

How to use logging

2014-02-16 Thread kumar
Hi folks, i'm new to python i understood the logging mechanism but unable to understand how these are applied in real time examples can any body help me out -- https://mail.python.org/mailman/listinfo/python-list

[issue20621] Issue with zipimport in 3.3.4 and 3.4.0rc1

2014-02-16 Thread Georg Brandl
Georg Brandl added the comment: Paul, could you confirm that backing out the 2807a5f011e4 changeset on the 3.3 branch fixes the problem? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20621

[issue20621] Issue with zipimport in 3.3.4 and 3.4.0rc1

2014-02-16 Thread Paul Moore
Paul Moore added the comment: Georg - see http://bugs.python.org/issue20621#msg211209 for what I did. That shows backing out did *not* fix the issue. But I did backout on the default branch, and my backout may not have worked as I explained. I just tried to do hg backout on the 3.3 branch and

[issue20621] Issue with zipimport in 3.3.4 and 3.4.0rc1

2014-02-16 Thread Georg Brandl
Georg Brandl added the comment: Yeah, just tried the backout, it doesn't apply cleanly anymore -- Modules/zipimport.c has apparently changed some more afterwards. I think using the parent changeset is the best thing to do at the moment, until Greg comes up with a patch. -- assignee:

[issue6143] IDLE - an extension to clear the shell window

2014-02-16 Thread Tal Einat
Tal Einat added the comment: FYI, with some help from Roger answering various questions, I've cooked up a version of ClearWindow supporting the current version of IDLE. This includes integration with the Squeezer extension. I haven't tested it, however, nor written appropriate tests. I hope

[issue20638] KeyError building the Python html doc with sphinx

2014-02-16 Thread Xavier de Gaye
New submission from Xavier de Gaye: Occurs on the tip of the Python default branch on ArchLinux when running 'make html PYTHON=python2' from Doc/. Traceback attached. -- assignee: docs@python components: Documentation files: sphinx-err-DH3qAl.log messages: 211311 nosy: docs@python,

[issue20638] KeyError building the Python html doc with sphinx

2014-02-16 Thread Georg Brandl
Georg Brandl added the comment: Which revision is your tip? In the latest revision, the documentation should refuse being built with 1.0.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20638

[issue20621] Issue with zipimport in 3.3.4 and 3.4.0rc1

2014-02-16 Thread Paul Moore
Paul Moore added the comment: OK, confirmed. Backing out to just before revision 2807a5f011e4 the problem has disappeared. Re-applying just 2807a5f011e4 causes the issue to appear again. -- ___ Python tracker rep...@bugs.python.org

[issue20570] Bundle pip 1.5.3 in Python 3.4rc2

2014-02-16 Thread Jeroen Ruigrok van der Werven
Jeroen Ruigrok van der Werven added the comment: Just to confirm that I, indeed, did not run into problems any more with RC1 trying to upgrade setuptools. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20570

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Wow, really? Thanks for finding this! -- nosy: +Mark.Shannon, benjamin.peterson, pitrou stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20637

[issue20639] pathlib.PurePath.with_suffix() does not allow removing the suffix

2014-02-16 Thread July Tikhonov
July Tikhonov added the comment: Proposed patch attached. -- Added file: http://bugs.python.org/file34100/pathlib-with_suffix.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20639 ___

[issue20639] pathlib.PurePath.with_suffix() does not allow removing the suffix

2014-02-16 Thread July Tikhonov
New submission from July Tikhonov: The changeset ef2b2ddd27c8 restricted the argument of Path.with_suffix() too much, and caused some strange behavior. Case 1: removing suffix completely is disallowed now. The following code worked before the fix: pathlib.PurePath('a', 'b.c').with_suffix('')

[issue20570] Bundle pip 1.5.3 in Python 3.4rc2

2014-02-16 Thread Nick Coghlan
Nick Coghlan added the comment: Donald, since you haven't been through an RC period before - just a reminder that Larry is going to need time to cherry pick the update into the release clone before rc2 on the 23rd. -- ___ Python tracker

[issue16728] Missing cross-reference in sequence glossary entry

2014-02-16 Thread A.M. Kuchling
Changes by A.M. Kuchling a...@amk.ca: -- stage: needs patch - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16728 ___ ___

[issue20640] Adds idle test for configHelpSourceEdit

2014-02-16 Thread Saimadhav Heblikar
New submission from Saimadhav Heblikar: This patch adds tests for Idle's configHelpSourceEdit.py module. There is however, a minor issue related to this patch,which is an attribute error occurring due to lines 108,115,128,139 on

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread Mark Shannon
Mark Shannon added the comment: Well spotted. I don't think that the line COPYVAL(tp_dictoffset); should be removed. inherit_special() is called from PyType_Ready which is used to initialise static TypeObjects. So builtin class B which doesn't set tp_dictoffset, but has builtin class A as its

[issue13663] pootle.python.org is outdated.

2014-02-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: pootle.python.org has been disabled. -- nosy: +benjamin.peterson resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13663

[issue20640] Adds idle test for configHelpSourceEdit

2014-02-16 Thread Todd Rovito
Changes by Todd Rovito rovit...@rovitotv.org: -- nosy: +Todd.Rovito ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20640 ___ ___ Python-bugs-list

[issue12211] Better document math.copysign behavior.

2014-02-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3ad7725b5013 by Andrew Kuchling in branch '3.3': #12211: clarify math.copysign() documentation and docstring http://hg.python.org/cpython/rev/3ad7725b5013 -- nosy: +python-dev ___ Python tracker

[issue9009] Improve quality of Python/dtoa.c

2014-02-16 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9009 ___

[issue12211] Better document math.copysign behavior.

2014-02-16 Thread A.M. Kuchling
A.M. Kuchling added the comment: Applied. I added two sentences describing the NaN behaviour. -- nosy: +akuchling resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

  1   2   >