Re: How do you refer to an iterator in docs?

2012-04-20 Thread Steven D'Aprano
I refer you to your subject line: "How do you refer to an iterator in docs?" In documentation, I refer to an iterator as an iterator, just as I would refer to a list as a list, a dict as a dict, or a string as a string. You may also find these useful: sequence something that obeys the sequ

Difference between 'imp' and 'importlib'

2012-04-20 Thread Frank Millman
Hi all I need the ability to execute a function by parsing a string containing the full path to the function. The string is multi-dotted. The last element is the function name, the second-last is the name of the module containing the function, and the balance is the path to the module. I have

Re: Framework for a beginner

2012-04-20 Thread Bryan
Gerd Niemetz wrote: > Take a look at http://www.web2py.com, a powerful and easy to learn python > framework, and the community at > https://groups.google.com/forum/?fromgroups#!forum/web2py is also very helpful > Web2py rocks. It does by default better than many, probably most, professional web

Re: os.system()

2012-04-20 Thread Yigit Turgut
On Apr 19, 11:02 pm, "Steve" wrote: > > "Yigit Turgut"  wrote in message > >news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... > > When I use os.system() function, script waits for termination of the > > windows that is opened by os.system() to continue thus throwing errors >

Re: os.system()

2012-04-20 Thread Chris Angelico
On Fri, Apr 20, 2012 at 8:51 PM, Yigit Turgut wrote: > On Apr 19, 11:02 pm, "Steve" wrote: >> > "Yigit Turgut"  wrote in message >> >news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... >> > When I use os.system() function, script waits for termination of the >> >> windows tha

code blocks in Python 2 and 3

2012-04-20 Thread Kiuhnm
Read about it here: http://mtomassoli.wordpress.com/2012/04/20/code-blocks-in-python/ or just download the module from here: https://bitbucket.org/mtomassoli/codeblocks/ The module codeblocks (codeblocks.py) includes a detailed docstring. Kiuhnm -- http://mail.python.org/mailman/listinfo/pyt

Pexpect support with Python3.2.3

2012-04-20 Thread Girish bist
Hi - I am using the pexpect version 2.4 with Python-3.2.3. I have written a small script to verify the pexpect support with Python 3.2.3. This script times out during the system call select execution. Can anyone please help us with the issue here. The same script is working fine with Python 2.7.3

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Jean-Michel Pichavant
Jon Clements wrote: On Thursday, 19 April 2012 13:21:20 UTC+1, Roy Smith wrote: Let's say I have a function which takes a list of words. I might write the docstring for it something like: def foo(words): "Foo-ify words (which must be a list)" What if I want words to be the more genera

Problem with running python cgi scripts through my browser

2012-04-20 Thread kreta06
Dear Python Tutors, I am having problems trying to send an email (using the smtplib module ) to send an email to myself over my browser using a python script, which is being called by an html form that I have created. My python cgi script is located in my cgi-bin directory, which I had made sure t

Python interface of Stanford Parser

2012-04-20 Thread ac27037
Dear Experts, Does anybody know how to use the Stanford Parser for Python Interface? I have tried many times, and don't know how to install and use. In fact, I have failed at that many times. Here is the interface: http://projects.csail.mit.edu/spatial/Stanford_Parser  Thank you! Sincerely,

setup.py

2012-04-20 Thread alister ware
What is the correct way to set the version of my package with distutils when i build it using python setup.py bdist_rpm I have __version__="x.x.x" in my main programm but if i add from import __version__ into setup.py if fails when my prog tries to import gi.repository. I suspect my approac

Python exercise club

2012-04-20 Thread kreta06
Hi Python Programmers or Newbies, I have just started a small group of python programmers (newbies and people with intermediate python programming experience) to develop and work weekly on a series of python exercises and come up with solutions to these exercises I develop. The aim is to improve o

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Roy Smith
In article <4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > I refer you to your subject line: > > "How do you refer to an iterator in docs?" > > In documentation, I refer to an iterator as an iterator, just as I would > refer to a list as a list, a dict as a dic

Re: Is there *any* real documentation to PyWin32?

2012-04-20 Thread kvam...@gmail.com
That's pretty unfair. If you know the Windows API, then the documentation is sufficient. If you need to learn the API, then it's unreasonable to expect Mark Hammond, et. al. to bundle the amount of material needed along with the software. The book is an excellent introduction to the Windows A

Re: Python interface of Stanford Parser

2012-04-20 Thread Stefan Behnel
ac27037, 20.04.2012 15:19: > Does anybody know how to use the Stanford Parser for Python Interface? I have > tried many times, and don't know how to install and use. In fact, I have > failed at that many times. Here is the interface: > > http://projects.csail.mit.edu/spatial/Stanford_Parser It

Re: can I overload operators like "=>", "->" or something like that?

2012-04-20 Thread Jacob MacDonald
On Thursday, April 19, 2012 11:09:52 PM UTC-7, Ben Finney wrote: > alex23 writes: > > > On Apr 20, 5:54 am, Jacob MacDonald wrote: > > > > > On Thursday, April 19, 2012 12:28:50 PM UTC-7, dmitrey wrote: > > > > can I somehow overload operators like "=>", "->" or something like > > > > that? > >

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Jacob MacDonald
On Friday, April 20, 2012 6:41:25 AM UTC-7, Roy Smith wrote: > In article <4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > > > I refer you to your subject line: > > > > "How do you refer to an iterator in docs?" > > > > In documentation, I refer to an iterator

Re: can I overload operators like "=>", "->" or something like that?

2012-04-20 Thread Nobody
On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote: > can I somehow overload operators like "=>", "->" or something like that? > (I'm searching for appropriate overload for logical implication "if a then > b") You cannot create new operators, but you can control how existing operators work on type

Using arguments in a decorator

2012-04-20 Thread Rotwang
Hi all, here's a problem I don't know how to solve. I'm using Python 2.7.2. I'm doing some stuff in Python which means I have cause to call functions that take a while to return. Since I often want to call such a function more than once with the same arguments, I've written a decorator to elim

Re: Using arguments in a decorator

2012-04-20 Thread Jon Clements
On Friday, 20 April 2012 16:57:06 UTC+1, Rotwang wrote: > Hi all, here's a problem I don't know how to solve. I'm using Python 2.7.2. > > I'm doing some stuff in Python which means I have cause to call > functions that take a while to return. Since I often want to call such a > function more th

Re: can I overload operators like "=>", "->" or something like that?

2012-04-20 Thread Kiuhnm
On 4/20/2012 17:50, Nobody wrote: On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote: can I somehow overload operators like "=>", "->" or something like that? (I'm searching for appropriate overload for logical implication "if a then b") You cannot create new operators, but you can control how

Re: Using arguments in a decorator

2012-04-20 Thread Peter Otten
Rotwang wrote: > I've written a > decorator to eliminate repeated calls by storing a dictionary whose > items are arguments and their results: > The problem is that the dictionary key > stored depends on how the function was called, even if two calls should > be equivalent; hence the original fun

Re: can I overload operators like "=>", "->" or something like that?

2012-04-20 Thread Tim Chase
On 04/20/12 11:45, Kiuhnm wrote: IOW, you can't define "->" or "=>", but you could define">=" or ">>". You can also "overload" '<-' ;) Oooh, that's evil. Slick, but evil! :-D -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggest design to accomodate non-unix platforms ?

2012-04-20 Thread Dan Stromberg
On Thu, Apr 19, 2012 at 5:14 PM, Chris Angelico wrote: > The question then is whether to choose or auto-detect. Attempting to > auto-detect could be quite inefficient; imagine if you have to call on > ssh every couple of seconds, and something in $PATH is on a slow > network share (or on a floppy

Re: can I overload operators like "=>", "->" or something like that?

2012-04-20 Thread Jussi Piitulainen
Kiuhnm writes: > On 4/20/2012 17:50, Nobody wrote: > > On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote: > > > >> can I somehow overload operators like "=>", "->" or something > >> like that? (I'm searching for appropriate overload for logical > >> implication "if a then b") > > > > You cannot cr

Re: can I overload operators like "=>", "->" or something like that?

2012-04-20 Thread Peter Otten
Kiuhnm wrote: > You can also "overload" '<-' ;) In the same spirit: http://code.activestate.com/recipes/384122-infix-operators/ -- http://mail.python.org/mailman/listinfo/python-list

Re: can I overload operators like "=>", "->" or something like that?

2012-04-20 Thread Kiuhnm
On 4/20/2012 19:49, Jussi Piitulainen wrote: Kiuhnm writes: On 4/20/2012 17:50, Nobody wrote: On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote: can I somehow overload operators like "=>", "->" or something like that? (I'm searching for appropriate overload for logical implication "if a then

Re: Suggest design to accomodate non-unix platforms ?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 3:44 AM, Dan Stromberg wrote: > > On Thu, Apr 19, 2012 at 5:14 PM, Chris Angelico wrote: >> >> The question then is whether to choose or auto-detect. Attempting to >> auto-detect could be quite inefficient; imagine if you have to call on >> ssh every couple of seconds, and

Re: can I overload operators like "=>", "->" or something like that?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 4:21 AM, Kiuhnm wrote: > Another option is to rely on ugly pseudo-operators: >  a .imp. b >  a .imp (b .imp. c) Or functions: implies(a,b) implies(a,implies(b,c)) That's the simplest option :) No hacks required, syntax is clear even if the reader doesn't know what you're

Re: os.system()

2012-04-20 Thread Adam Skutt
On Apr 20, 6:51 am, Yigit Turgut wrote: > On Apr 19, 11:02 pm, "Steve" wrote: > > > > "Yigit Turgut" wrote in message > > >news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... > > > When I use os.system() function, script waits for termination of the > > > windows that is ope

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

2012-04-20 Thread dmitrey
I have spent some time searching for a bug in my code, it was due to different work of "is" with () and []: >>> () is () True >>> [] is [] False (Python 2.7.2+ (default, Oct 4 2011, 20:03:08) [GCC 4.6.1] ) Is this what it should be or maybe yielding unified result is better? D. -- http://mail.p

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

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 5:10 AM, dmitrey wrote: > I have spent some time searching for a bug in my code, it was due to > different work of "is" with () and []: () is () > True [] is [] > False Okay, let's take a step back. What do you expect "is" to be doing? It doesn't check for equali

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

2012-04-20 Thread Robert Kern
On 4/20/12 8:10 PM, dmitrey wrote: I have spent some time searching for a bug in my code, it was due to different work of "is" with () and []: () is () True The empty tuple is unique, immutable, and common so the Python runtime optimizes this by reusing the same object, much like small integ

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

2012-04-20 Thread Rotwang
On 20/04/2012 20:10, dmitrey wrote: I have spent some time searching for a bug in my code, it was due to different work of "is" with () and []: () is () True [] is [] False (Python 2.7.2+ (default, Oct 4 2011, 20:03:08) [GCC 4.6.1] ) Is this what it should be or maybe yielding unified resu

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

2012-04-20 Thread Alain Ketterlin
dmitrey writes: > I have spent some time searching for a bug in my code, it was due to > different work of "is" with () and []: () is () > True [] is [] > False > > (Python 2.7.2+ (default, Oct 4 2011, 20:03:08) > [GCC 4.6.1] ) > > Is this what it should be or maybe yielding unified re

Appending to []

2012-04-20 Thread Jan Sipke
Can you explain why there is a difference between the following two statements? >>> a = [] >>> a.append(1) >>> print a [1] >>> print [].append(1) None Best regards, Jan Sipke -- http://mail.python.org/mailman/listinfo/python-list

Re: Appending to []

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 6:03 AM, Jan Sipke wrote: > Can you explain why there is a difference between the following two > statements? > a = [] a.append(1) print a > [1] This looks at the list after appending. print [].append(1) > None This looks at the return value of the ap

Re: Appending to []

2012-04-20 Thread Rotwang
On 20/04/2012 21:03, Jan Sipke wrote: Can you explain why there is a difference between the following two statements? a = [] a.append(1) print a [1] print [].append(1) None append is a method of the list object []. Methods, in general, both do something to the objects of which they are a

Re: Appending to []

2012-04-20 Thread Kiuhnm
On 4/20/2012 22:03, Jan Sipke wrote: Can you explain why there is a difference between the following two statements? a = [] a.append(1) print a [1] print [].append(1) None Try this one: a = [] print a.append(1) Does that answer your question? Kiuhnm -- http://mail.python.org/mai

Re: Appending to []

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 6:17 AM, Rotwang wrote: > In general there's no reason why > a.method(arguments) print a > > will print the same thing as > print a.method(arguments) > > since a method doesn't assign the value it returns to the instance on which > it is called; what it does

Re: Using arguments in a decorator

2012-04-20 Thread Rotwang
On 20/04/2012 17:10, Jon Clements wrote: On Friday, 20 April 2012 16:57:06 UTC+1, Rotwang wrote: Hi all, here's a problem I don't know how to solve. I'm using Python 2.7.2. I'm doing some stuff in Python which means I have cause to call functions that take a while to return. Since I often want

Re: can I overload operators like "=>", "->" or something like that?

2012-04-20 Thread Steven W. Orr
On 4/19/2012 3:28 PM, dmitrey wrote: hi all, can I somehow overload operators like "=>", "->" or something like that? (I'm searching for appropriate overload for logical implication "if a then b") Thank you in advance, D. This tickled a memory from decades back when I worked in PL/I. They have

Re: can I overload operators like "=>", "->" or something like that?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 7:34 AM, Steven W. Orr wrote: > Then define a class called Bool that redefines things like __rlshift__ and > __rrshift__. That would get >>= and <<= for Implications and nodus tolens. > It's not a total solution. I can't see how you're going to get IFF, NAND and > NOR. IFF

Different results for different versions of urllib2

2012-04-20 Thread Diego Manenti Martins
Hi. Anybody knows the data is sent in a different way for Python 2.5, 2.6 and 2.7 using this code: >>> import urllib2 >>> url = 'http://server.com/post_image?tid=zoV6LJ' >>> f = open('test.jpg') >>> data = f.read() >>> res = urllib2.urlopen(url, data) It works the same way for python2.5 and pytho

Re: Different results for different versions of urllib2

2012-04-20 Thread Terry Reedy
On 4/20/2012 6:47 PM, Diego Manenti Martins wrote: Anybody knows the data is sent in a different way for Python 2.5, 2.6 and 2.7 using this code: You could check the What's New for 2.7 and see if there is any mention of a change to urllib2. Or diff the 2.6 and 2.7 versions of urllib2.py. i

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Terry Reedy
On 4/20/2012 9:41 AM, Roy Smith wrote: Except that "list of foos" and "sequence of foos" make sense from a grammar standpoint, but "iterator of foos" does not. Or maybe it does? I consider it grammatical, but idiomatically, it *is* an innovation. Language evolves as needs evolve. -- Terry

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

2012-04-20 Thread Roy Smith
In article <877gxajit0@dpt-info.u-strasbg.fr>, Alain Ketterlin wrote: > Tuples are immutable, while lists are not. If you really want to have fun, consider this classic paradox: >>> [] is [] False >>> id([]) == id([]) True -- http://mail.python.org/mailman/listinfo/python-list

Re: Using arguments in a decorator

2012-04-20 Thread Ian Kelly
On Fri, Apr 20, 2012 at 9:57 AM, Rotwang wrote: > As far as I know, the decorated function will always return the same value > as the original function. The problem is that the dictionary key stored > depends on how the function was called, even if two calls should be > equivalent; hence the origi

Re: Using arguments in a decorator

2012-04-20 Thread Ian Kelly
On Fri, Apr 20, 2012 at 6:07 PM, Ian Kelly wrote: >    (args, varargs, varkw, defaults) = inspect.getargspec(func) >    if varargs: >        args.append(varargs) >    if varkw: >        args.append("tuple(sorted(%s.items()))" % varkw) Note that in Python 3, this would need to become something lik

Re: Different results for different versions of urllib2

2012-04-20 Thread Dave Angel
On 04/20/2012 06:47 PM, Diego Manenti Martins wrote: > Hi. > Anybody knows the data is sent in a different way for Python 2.5, 2.6 > and 2.7 using this code: > import urllib2 url = 'http://server.com/post_image?tid=zoV6LJ' f = open('test.jpg') data = f.read() res = urllib2.

Re: Different results for different versions of urllib2

2012-04-20 Thread Diego Manenti Martins
On Fri, Apr 20, 2012 at 10:08 PM, Dave Angel wrote: > On 04/20/2012 06:47 PM, Diego Manenti Martins wrote: >> Hi. >> Anybody knows the data is sent in a different way for Python 2.5, 2.6 >> and 2.7 using this code: >> > import urllib2 > url = 'http://server.com/post_image?tid=zoV6LJ' >

Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread Foster Rilindo
I can't seem to concatenate. I got binary files here: yvaine:disk rilindo$ ls -lah total 61440 drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47 . drwxr-xr-x 10 rilindo staff 340B Apr 20 19:45 .. -rw-r--r-- 1 rilindo staff20M Apr 20 20:00 disk1 -rw-r--r-- 1 rilindo staff10M Apr

Fwd: Re: Different results for different versions of urllib2

2012-04-20 Thread Dave Angel
You forgot to include the list in your response. I don't normally respond to private messages, but I'll make an exception. On Fri, Apr 20, 2012 at 10:08 PM, Dave Angel wrote: > On 04/20/2012 06:47 PM, Diego Manenti Martins wrote: >> Hi. >> Anybody knows the data is sent in a different way for P

Re: Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 11:03 AM, Foster Rilindo wrote: > Is this right way to concatenate a file or is there a better way? I'd be inclined to ignore shutil and simply open one file for reading, the other for appending, and manually transfer data from one to the other. open(disk1,"ab").write(ope

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 9:40 AM, Terry Reedy wrote: > On 4/20/2012 9:41 AM, Roy Smith wrote: > >> Except that "list of foos" and "sequence of foos" make sense from a >> grammar standpoint, but "iterator of foos" does not.  Or maybe it does? > > I consider it grammatical, but idiomatically, it *is*

Re: Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread Dave Angel
On 04/20/2012 09:03 PM, Foster Rilindo wrote: > I can't seem to concatenate. > > I got binary files here: > > yvaine:disk rilindo$ ls -lah > total 61440 > drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47 . > drwxr-xr-x 10 rilindo staff 340B Apr 20 19:45 .. > -rw-r--r-- 1 rilindo staff20

Re: Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread MRAB
On 21/04/2012 02:03, Foster Rilindo wrote: I can't seem to concatenate. I got binary files here: yvaine:disk rilindo$ ls -lah total 61440 drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47 . drwxr-xr-x 10 rilindo staff 340B Apr 20 19:45 .. -rw-r--r-- 1 rilindo staff20M Apr 20 20:00 di

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Roy Smith
In article <4f921a2d$0$29965$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Fri, 20 Apr 2012 09:41:25 -0400, Roy Smith wrote: > > > In article <4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com>, > > Steven D'Aprano wrote: > > > >> I refer you to your subject line: > >>

Re: Re: Different results for different versions of urllib2

2012-04-20 Thread Diego Manenti Martins
On Fri, Apr 20, 2012 at 11:09 PM, Dave Angel wrote: > You forgot to include the list in your response.  I don't normally > respond to private messages, but I'll make an exception. Sorry about that and thanks. >> On 04/20/2012 06:47 PM, Diego Manenti Martins wrote: >>> Hi. >>> Anybody knows the d

Re: Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread Foster Rilindo
Nevermind. Dumb mistake. I should have used: destination = open(disk1,'ab') Doh. On Apr 20, 2012, at 8:03 PM, Foster Rilindo wrote: > I can't seem to concatenate. > > I got binary files here: > > yvaine:disk rilindo$ ls -lah > total 61440 > drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47

Re: Different results for different versions of urllib2

2012-04-20 Thread Dave Angel
On 04/20/2012 11:06 PM, Diego Manenti Martins wrote: > On Fri, Apr 20, 2012 at 11:09 PM, Dave Angel wrote: >> You forgot to include the list in your response. I don't normally >> respond to private messages, but I'll make an exception. > Sorry about that and thanks. > >>> On 04/20/2012 06:47 PM,

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Steve Howell
On Apr 20, 8:01 pm, Roy Smith wrote: > In article <4f921a2d$0$29965$c3e8da3$54964...@news.astraweb.com>, >  Steven D'Aprano wrote: > > > > > > > > > > > On Fri, 20 Apr 2012 09:41:25 -0400, Roy Smith wrote: > > > > In article <4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com>, > > >  Steven D'A

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 1:01 PM, Roy Smith wrote: > Because an iterator isn't a container.  I don't know, maybe it does make > sense, but my first impression is that it sounds wrong. > > A basket of apples is a basket which contains apples, in the same way a > list contains foos.  But an iterator

Re: Difference between 'imp' and 'importlib'

2012-04-20 Thread Eric Snow
On Fri, Apr 20, 2012 at 1:30 AM, Frank Millman wrote: > Hi all > > I need the ability to execute a function by parsing a string containing the > full path to the function. The string is multi-dotted. The last element is > the function name, the second-last is the name of the module containing the

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

2012-04-20 Thread John O'Hagan
On Sat, 21 Apr 2012 04:25:36 +0100 Rotwang wrote: > On 21/04/2012 01:01, Roy Smith wrote: > > In article<877gxajit0@dpt-info.u-strasbg.fr>, > > Alain Ketterlin wrote: > > > >> Tuples are immutable, while lists are not. > > > > If you really want to have fun, consider this classic paradox:

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Steven D'Aprano
On Fri, 20 Apr 2012 23:01:08 -0400, Roy Smith wrote: > In article <4f921a2d$0$29965$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> On Fri, 20 Apr 2012 09:41:25 -0400, Roy Smith wrote: >> >> > In article <4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com>, >> > Steven D'A

Re: Re: How do you refer to an iterator in docs?

2012-04-20 Thread Evan Driscoll
On 4/20/2012 22:01, Roy Smith wrote: > A basket of apples is a basket which contains apples, in the same way a > list contains foos. But an iterator doesn't contain anything. You > wouldn't say, "a spigot of water", because the spigot isn't a container > holding the water. It is simply a mech

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

2012-04-20 Thread Dave Angel
On 04/20/2012 11:25 PM, Rotwang wrote: > On 21/04/2012 01:01, Roy Smith wrote: >> In article<877gxajit0@dpt-info.u-strasbg.fr>, >> Alain Ketterlin wrote: >> >>> Tuples are immutable, while lists are not. >> >> If you really want to have fun, consider this classic paradox: >> > [] is [] >

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

2012-04-20 Thread john . tantalo
On Friday, April 20, 2012 12:34:46 PM UTC-7, Rotwang wrote: > I believe it says somewhere in the Python docs that it's undefined and > implementation-dependent whether two identical expressions have the same > identity when the result of each is immutable I was curious where that might be on my

Re: Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread Peter Otten
Chris Angelico wrote: > On Sat, Apr 21, 2012 at 11:03 AM, Foster Rilindo wrote: >> Is this right way to concatenate a file or is there a better way? > > I'd be inclined to ignore shutil and simply open one file for reading, > the other for appending, and manually transfer data from one to the >