Re: Question on Python 3 shell restarting

2012-04-10 Thread Terry Reedy
On 4/10/2012 3:28 PM, Benjamin Kaplan wrote: On Tue, Apr 10, 2012 at 2:36 PM, Franck Ditter wrote: In article Hum, but when I press, Ctl-F6, nothing happens !!??!! F6 gives me char. (MacOS-X Lion, France, Idle 3.3.0a2) This is what Ctrl-F6 does on Windows. >>> =

Re: f python?

2012-04-10 Thread Terry Reedy
On 4/10/2012 4:10 PM, Rainer Weikusat wrote: 'car' and 'cdr' refer to cons cells in Lisp, not to strings. How the first/rest terminology can be sensibly applied to 'C strings' (which are similar to linked-lists in the sense that there's a 'special termination value' instead of an explicit length

Re: Error in MD5 checksums of the 2.7.3 release page.

2012-04-12 Thread Terry Reedy
On 4/12/2012 6:11 AM, Jérémy Bethmont wrote: There is an error in the MD5 checksums section of the following page: http://python.org/download/releases/2.7.3/ Python-3.1.5.tgz, Python-3.1.5.tar.bz2 and Python-3.1.5.tar.xz are listed instead of: Python-2.7.3.tgz, Python-2.7.3.tar.bz2 and Pyt

Re: remainder of dividing by zero

2012-04-12 Thread Terry Reedy
On 4/12/2012 6:34 PM, Ethan Furman wrote: Okay, so I haven't asked a stupid question in a long time and I'm suffering withdrawal symptoms... ;) 5 % 0 = ? It seems to me that the answer should be 5: no matter how many times we add 0 to itself, the remainder of the intermediate step will be 5. I

Re: Subprocess troubles from a daemon

2012-04-13 Thread Terry Reedy
On 4/13/2012 7:04 AM, Eiríkur Hjartarson wrote: Hi, I think I have possibly found a bug in the subprocess module. The (potential) bug appears when executing a subprocess from a daemon (after double-forking). This is on RHEL 6.2 with python version 2.6.6. What happens is you use the new 2.7.3

Re: escaping

2012-04-15 Thread Terry Reedy
On 4/15/2012 5:07 PM, Kiuhnm wrote: This is the behavior I need: path = path.replace('\\', '') Is there a better way? For one-time use, and given that you cannot un-double with the r prefix, not that I know of. For using the substrings multiple times, name them. >>> s = r'abc\cd\ef' >>>

Re: f python?

2012-04-15 Thread Terry Reedy
On 4/15/2012 12:16 PM, Ian Kelly wrote: On Sat, Apr 14, 2012 at 8:57 PM, Shmuel Metz wrote: In<87aa2iz3l1@kuiper.lan.informatimago.com>, on 04/11/2012 at 05:32 PM, "Pascal J. Bourguignon" said: You're confused. C doesn't have arrays. Lisp has arrays. C only has vectors Neither C

Re: No such file or directory: 'c:\\windows\\temp\\test'

2012-04-15 Thread Terry Reedy
On 4/15/2012 5:13 AM, contro opinion wrote: >>> f=open(r'c:\windows\temp\test','r') >>> f=open('c:\\windows\\temp\\test','r') Your life will be much happier is you use forward slashes for filenames in Python programs. f = open('c:/windows/temp/test', 'r') You only need backslashes when

Re: Python Gotcha's?

2012-04-15 Thread Terry Reedy
On 4/15/2012 4:01 PM, Bryan wrote: On Windows the file extension determines what executable opens the file. Running both Python 2 and Python 3 on Windows is painful where it doesn't need to be. I'd like to encourage my users to check out Python 3, but installing it on Windows will take over the

Re: f python?

2012-04-15 Thread Terry Reedy
On 4/15/2012 6:59 PM, Ian Kelly wrote: On Sun, Apr 15, 2012 at 4:49 PM, Terry Reedy wrote: On 4/15/2012 12:16 PM, Ian Kelly wrote: On Sat, Apr 14, 2012 at 8:57 PM, Shmuel Metz wrote: In<87aa2iz3l1@kuiper.lan.informatimago.com>, on 04/11/2012 at 05:32 PM, "Pascal J.

Re: contributing to sqlite documentation

2012-04-16 Thread Terry Reedy
On 4/16/2012 4:12 AM, Pedro Larroy wrote: I would like to contribute to this documentation http://docs.python.org/library/sqlite3.html > Can somebody point me how to best do it? Documentations improvement sometimes start with discussion on this list. Both code and documentation issues are hand

Re: Making helper methods more concise

2012-04-16 Thread Terry Reedy
On 4/16/2012 8:01 AM, Alan Ristow wrote: Hi all, I have defined a class that includes a number of helper methods that are useful to me, but pretty redundant. Something like so, where I maintain a list of tuples: class A(object): def __init__(self): self.listing = [] # This m

Re: pygame: output to file?

2012-04-16 Thread Terry Reedy
On 4/16/2012 8:37 AM, superpollo wrote: alex23 ha scritto: On Apr 16, 7:34 pm, superpollo wrote: is there a way to convert the graphical output of a pygame application to a mpeg file or better an animated gif? i mean, not using an external capture program... There is, but it's probably not g

Re: Pyjamas 0.8.1~+alpha1 released

2012-04-16 Thread Terry Reedy
On 4/16/2012 5:21 AM, Luke Kenneth Casson Leighton wrote: This is the 0.8.1~+alpha1 release of Pyjamas. Pyjamas comprises several projects, one of which is a stand-alone python-to-javascript compiler; other projects include a Graphical Widget Toolkit, such that pyjamas applications can run eithe

Re: Bug in Python

2012-04-17 Thread Terry Reedy
On 4/18/2012 12:47 AM, Hans Mulder wrote: On 18/04/12 03:08:08, Kiuhnm wrote: print(1) print(2) print(3) with open('test') as f: data = f.read() with open('test') as f: data = f.read() How much of that is needed to trigger the problem? All three prints? Any of them? I get the same

Re: Bug in Python

2012-04-18 Thread Terry Reedy
On 4/18/2012 10:22 AM, Kiuhnm wrote: The bug was confirmed and a patch is now available: http://bugs.python.org/issue14612 And applied to 2.7, 3.2, and 3.3. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: how python dir works

2012-04-18 Thread Terry Reedy
On 4/18/2012 11:56 AM, cheung wrote: how does the function "dir" works, > where can I get the python-c source of dir in py2.7 project. Interesting question. The CPython source is here: hg.python.org/cpython/ From there, select branches, 2.7, and browse. From there, Python/bltinmodule.c has so

Re: Framework for a beginner

2012-04-19 Thread Terry Reedy
On 4/19/2012 7:14 AM, Kiuhnm wrote: On 4/19/2012 6:21, lkcl wrote: yeah, it does :) python is... the best word i can describe it is: it's beautiful. it has an elegance of expression that is only marred by the rather silly mistake of not taking map, filter and reduce into the list object itself:

Re: Framework for a beginner

2012-04-19 Thread Terry Reedy
On 4/19/2012 7:20 AM, Alek Storm wrote: Why not use list comprehension syntax? For 3.x, that should be shortened to "Why not use comprehension syntax?", where comprehensions by default become generator expressions. These: > Map: [val+1 for val in some_list] > Filter: [val for val in some_li

Re: Framework for a beginner

2012-04-19 Thread Terry Reedy
On 4/19/2012 8:12 AM, lkcl luke wrote: you don't *have* to use lambdas with map and reduce, you just have touse a function, > where a lambda happens to be a nameless function. Abbreviated statements like the above sometimes lead people to think that there is more difference between def functi

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

2012-04-19 Thread Terry Reedy
On 4/19/2012 11:51 AM, Jacob MacDonald wrote: When I talk about an iterable, I say "iterable". Ditto. Examples from manual: "filter(function, iterable) Construct an iterator from those elements of iterable for which function returns true." (I would work this differently.) "map(function, iter

Re: with statement

2012-04-19 Thread Terry Reedy
On 4/19/2012 1:15 PM, Kiuhnm wrote: A with statement is not at the module level only if it appears inside a function definition or a class definition. This is true, I believe, of all statements. Am I forgetting something? Comprehensions (in Py3) and lambda expressions also introduce new loc

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

2012-04-19 Thread Terry Reedy
On 4/19/2012 5:32 PM, Cameron Simpson wrote: On 19Apr2012 14:32, Terry Reedy wrote: | On 4/19/2012 11:51 AM, Jacob MacDonald wrote: |> When I talk about an iterable, I say "iterable". | | Ditto. I used to, but find myself saying "sequence" these days. It reads better, b

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

2012-04-19 Thread Terry Reedy
On 4/19/2012 6:16 PM, Cameron Simpson wrote: On 19Apr2012 18:07, Terry Reedy wrote: | On 4/19/2012 5:32 PM, Cameron Simpson wrote: |> On 19Apr2012 14:32, Terry Reedy wrote: |> | On 4/19/2012 11:51 AM, Jacob MacDonald wrote: |> |> When I talk about an iterable, I s

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: Appending to []

2012-04-21 Thread Terry Reedy
On 4/21/2012 9:08 AM, Dave Angel wrote: On 04/21/2012 08:48 AM, Bernd Nawothnig wrote: On 2012-04-20, Rotwang wrote: since a method doesn't assign the value it returns to the instance on which it is called; what it does to the instance and what it returns are two completely different things. R

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

2012-04-21 Thread Terry Reedy
On 4/21/2012 9:02 AM, Bernd Nawothnig wrote: You should better not rely on that result. I would consider it to be an implementation detail. I may be wrong, but would an implementation that results in () is () ==> False be correct or is the result True really demanded by the language specifica

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

2012-04-22 Thread Terry Reedy
On 4/22/2012 3:43 PM, John Nagle wrote: On 4/20/2012 9:34 PM, john.tant...@gmail.com wrote: 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 sam

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

2012-04-23 Thread Terry Reedy
On 4/23/2012 12:38 AM, Devin Jeanpierre wrote: On Sun, Apr 22, 2012 at 9:22 PM, Terry Reedy wrote: On 4/22/2012 3:43 PM, John Nagle wrote: On 4/20/2012 9:34 PM, john.tant...@gmail.com wrote: On Friday, April 20, 2012 12:34:46 PM UTC-7, Rotwang wrote: I believe it says somewhere in the

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

2012-04-23 Thread Terry Reedy
On 4/23/2012 1:55 PM, Devin Jeanpierre wrote: On Mon, Apr 23, 2012 at 1:21 PM, Benjamin Kaplan wrote: On Mon, Apr 23, 2012 at 1:01 PM, Paul Rubin wrote: The "is" operator is perfectly defined. But it doesn't check to see whether two objects hold equivalent values, it checks whether they are t

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

2012-04-23 Thread Terry Reedy
On 4/23/2012 4:37 PM, Devin Jeanpierre wrote: However, you appear to be trying to shift the goalposts. Either "1 is 1" is always True, or always False, or sometimes one or the other. If I'm mistaken and it so happens that numeric constants are guaranteed somewhere to always be cached, then repla

Re: Strange __import__() behavior

2012-04-25 Thread Terry Reedy
On 4/25/2012 4:05 PM, Frank Miles wrote: I have an exceedingly simple function that does a "named import". It works perfectly for one file "r"- and fails for the second "x". If I reverse the order of being called, it is still "x" that fails, and "r" still succeeds. os.access() always reports th

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

2012-04-25 Thread Terry Reedy
On 4/25/2012 4:49 PM, Adam Skutt wrote: Identity and equality are distinct concepts in programming languages. There's nothing that can be done about that, and no particularly good reason to force certain language behaviors because some "programmers" have difficulty with the distinction. Though,

Re: csv: No fields, or one field?

2012-04-26 Thread Terry Reedy
On 4/26/2012 9:12 AM, Neil Cerutti wrote: On 2012-04-26, Neil Cerutti wrote: I made the following wrong assumption about the csv EBNF recognized by Python (ignoring record seps): record -> field {delim field} Is that in the docs? There's at least some csv "standard" documents requiring m

Re: Is "PyIntBlocks are never returned to the system before shutdown" right?

2012-04-26 Thread Terry Reedy
On 4/26/2012 10:21 AM, ZHONG Chen wrote: "PyIntBlocks are never returned to the system before shutdown" I saw this comment in Python 2.6.8's source code: Objects/intobject.c line 25 But in the function PyInt_ClearFreeList() It will call PyMem_FREE(list) for empty int block. Why? Before procee

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

2012-04-26 Thread Terry Reedy
On 4/26/2012 1:48 AM, John Nagle wrote: This assumes that everything is, internally, an object. In CPython, that's the case, because Python is a naive interpreter and everything, including numbers, is "boxed". That's not true of PyPy or Shed Skin. So does "is" have to force the creation of a te

Re: (3.2) Overload print() using the C API?

2012-04-27 Thread Terry Reedy
On 4/27/2012 4:55 AM, Stefan Behnel wrote: I want the script itself to update a window in the host application (via the extension) every time the script calls print(). Then replace sys.stdout (and maybe also sys.stderr) by another object that does what you want whenever its write() method is c

Re: confusing doc: mutable and hashable

2012-04-28 Thread Terry Reedy
On 4/28/2012 2:09 PM, laymanzh...@gmail.com wrote: In my understanding, there is no directly relation between mutable and hashable in Python. Any class with __hash__ function is "hashable". According the wiki: http://en.wikipedia.org/wiki/Immutable_object In object-oriented and functional prog

Re: algorithm does python use to compare two strings

2012-04-29 Thread Terry Reedy
On 4/29/2012 3:59 AM, J. Mwebaze wrote: I am just wondering which specific algorithm does python use to compare two strings. 'Python' does not use algorithms, implementations do. CPython may check id and or hash before doing a character-by-char comparison (or perhaps multiple chars at a time)

Re: confusing doc: mutable and hashable

2012-04-29 Thread Terry Reedy
On 4/29/2012 3:57 AM, John O'Hagan wrote: How do function objects fit into this scheme? They have __hash__, __eq__, seem to work as dict keys and are mutable. Is it because their hash value doesn't change? I suspect functions use the default equality and hash based on id, which does not chang

Re: algorithm does python use to compare two strings

2012-04-29 Thread Terry Reedy
On 4/29/2012 6:05 AM, Terry Reedy wrote: On 4/29/2012 3:59 AM, J. Mwebaze wrote: I am just wondering which specific algorithm does python use to compare two strings. 'Python' does not use algorithms, implementations do. CPython may check id and or hash before doing a charact

Re: Some posts do not show up in Google Groups

2012-04-30 Thread Terry Reedy
On 4/30/2012 2:20 AM, Frank Millman wrote: Hi all For a while now I have been using Google Groups to read this group, but on the odd occasion when I want to post a message, I use Outlook Express, as I know that some people reject all messages from Google Groups due to the high spam ratio (whi

Re: For loop

2012-04-30 Thread Terry Reedy
On 4/30/2012 6:41 AM, viral shah wrote: Hi I want to make a pattern like this *1 22 333 5 Python 3: >>> for i in range(1,6): print(i*str(i)) 1 22 333 5 -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Sort comparison

2012-05-01 Thread Terry Reedy
On 5/1/2012 1:25 AM, Dan Stromberg wrote: Anyway, here's the comparison, with code and graph: http://stromberg.dnsalias.org/~strombrg/sort-comparison/ (It's done in Pure python and Cython, with a little m4). Interesting, BTW, that an unstable quicksort in Cython was approaching timsort as a C

Re: DateTime objectFormatting

2012-05-02 Thread Terry Reedy
On 5/2/2012 10:49 AM, Nikhil Verma wrote: This was posted as html (with text copy). Please send messages to the list and newsgroup as text (only). Html sometimes does strange things, especially if you post code. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: key/value store optimized for disk storage

2012-05-02 Thread Terry Reedy
On 5/2/2012 10:14 PM, Steve Howell wrote: This is slightly off topic, but I'm hoping folks can point me in the right direction. I'm looking for a fairly lightweight key/value store that works for this type of problem: ideally plays nice with the Python ecosystem the data set is static, an

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-03 Thread Terry Reedy
On 5/3/2012 8:36 PM, Peng Yu wrote: Hi, list(a_set) When convert two sets with the same elements to two lists, are the lists always going to be the same (i.e., the elements in each list are ordered the same)? Is it documented anywhere? "A set object is an unordered collection of distinct hash

Re: pyjamas / pyjs

2012-05-04 Thread Terry Reedy
On 5/4/2012 12:52 AM, John O'Hagan wrote: Just read the thread on pyjamas-dev. Even without knowing anything about the lead-up to the coup, its leader's linguistic contortions trying to justify it And what is the name of the miscreant, so we know who to have nothing to with? -- Terry Jan Re

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Terry Reedy
On 5/4/2012 8:00 AM, Peng Yu wrote: On Fri, May 4, 2012 at 6:21 AM, Chris Angelico wrote: On Fri, May 4, 2012 at 8:14 PM, Peng Yu wrote: Thanks. This is what I'm looking for. I think that this should be added to the python document as a manifestation (but nonnormalized) of what "A set object

Re: for loop: weird behavior

2012-05-04 Thread Terry Reedy
On 5/4/2012 4:33 PM, ferreirafm wrote: Hi there, I simply can't print anything in the second for-loop bellow: # #!/usr/bin/env python import sys filename = sys.argv[1] outname = filename.split('.')[0] + '_pdr.dat' begin = 'Distance distribution' end = 'R

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Terry Reedy
Peng, I actually am thinking about it. Underlying problem: while unordered means conceptually unordered as far as the collection goes, the items in the collection, if homogenous enough, may have a natural order, which users find hard to ignore. Even if not comparable, an implementation such as

Re: Workshop on Design Patterns and Advanced OOPS, Bangalore

2012-05-07 Thread Terry Reedy
On 5/7/2012 6:23 AM, Exam Aya wrote: For anyone working on object oriented programing languages like C++, Java, C#, Python, PHP, etc. this workshop is a must. It goes through the set of design patterns that started it all - Go4 - (Gang of 4) patterns. The workshop will very interactive and each

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-08 Thread Terry Reedy
On 5/8/2012 9:47 AM, Chris Angelico wrote: On Tue, May 8, 2012 at 11:43 PM, Devin Jeanpierre wrote: There is no "both projects". there was Luke's project, and then Risinger stole it and it's Risinger's project. There is only that one thing -- Luke has no """fork""" of his own codebase. Presu

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-08 Thread Terry Reedy
On 5/8/2012 12:42 PM, Chris Angelico wrote: On Wed, May 9, 2012 at 2:12 AM, Terry Reedy wrote: You still have it backwards. Risinger forked the project with a new code host and mailing list, but stole the name and and some data in the process and made the false claim that his fork was the

Re: How to get outer class name from an inner class?

2012-05-08 Thread Terry Reedy
On 5/8/2012 4:05 PM, John Gordon wrote: I'm trying to come up with a scheme for organizing exceptions in my application. Currently, I'm using a base class which knows how to look up the text of a specific error in a database table, keyed on the error class name. The base class looks like this:

Re: Using modules from Debian "python3-..." packages with locally compiled Python 3.3

2012-05-08 Thread Terry Reedy
On 5/8/2012 3:13 PM, Edward C. Jones wrote: I use up-to-date Debian testing (wheezy), amd64 architecture. I downloaded, compiled and installed Python 3.3.0 alpha 3 (from python.org) using "altinstall". Debian wheezy comes with python3.2 (and 2.6 and 2.7). I installed the Debian package "python3-b

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-08 Thread Terry Reedy
On 5/8/2012 5:47 PM, Terry Reedy wrote: From what others have posted, it has a new code repository (that being the ostensible reason for the fork), project site, and mailing list -- the latter two incompetently. Apparently, the only thing he has kept are the domain and project names (the

Re: Finding the line number of an 'else' statement via ast

2012-05-11 Thread Terry Reedy
On 5/11/2012 12:35 AM, Michael Rene Armida wrote: Given this source: def do_something(val): if val: return 'a' else: return 'b' How do I get the line number of the "else:" line, using the ast module? The grammar only includes the 'orelse' list: If(expr test, s

Re: Newbie naive question ... int() throws ValueError

2012-05-11 Thread Terry Reedy
On 5/11/2012 1:55 AM, John Terrak wrote: I couldnt find anywhere in the documentation that int() can throw a ValueError. I checked the "The Python Language Reference", and the "The Python Standard Library " to no avail. Did I missed something? To add to Chris' answer: If the domain of a funct

Re: to solve the simple equation

2012-05-12 Thread Terry Reedy
On 5/12/2012 9:30 AM, contro opinion wrote: there is a simple equation, 50/((1+x)**0.9389)+50/((1+x)**1.9389)+1050/((1+x)**2.9389)-1045=0 i input : from sympy import * x=Symbol('x') solve(50/((1+x)**0.9389)+50/((1+x)**1.9389)+1050/((1+x)**2.9389)-1045, x) Traceback (most recent call last):

Re: How to call and execute C code in Python?

2012-05-13 Thread Terry Reedy
On 5/13/2012 9:25 AM, David Shi wrote: Can anyone tell me how to call and exectute C code in Python? Regards. David *From:* "python-list-requ...@python.org" *To:* python-list@python.org *Sent:* Friday, 11 May 2012, 5:35

Re: Where is the most recent Tkinter information

2012-05-16 Thread Terry Reedy
On 5/16/2012 11:02 PM, Mark R Rivet wrote: It seems like all the info on tkinter is around the 2000 time frame. Is tkinter still being developed/supported? tkinter is CPython's tk interface. tcl/tk is still being developed at Active State. The Windows release for Py 3.3 will come with 8.5.11,

Re: Newbie questions on import & cmd line run

2012-05-16 Thread Terry Reedy
On 5/16/2012 9:45 PM, gwhite wrote: Hi, I am a newbie running the latest pythonxy (2.7.2.1)& spyder and python 2.7.2. I suspect my questions are mostly basic to python, and not specific to Spyder or iPython. Note: Up until now, I mainly used MATLAB, and thus need to de-program myself appropr

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-17 Thread Terry Reedy
On 5/17/2012 4:23 AM, Devin Jeanpierre wrote: str.isdecimal = isdecimal(...) S.isdecimal() -> bool Return True if there are only decimal characters in S, False otherwise. Help on method_descriptor in str: str.isdigit = isdigit(...) S.isdigit() -> bool Return True i

Re: tiny script has memory leak

2012-05-17 Thread Terry Reedy
On 5/17/2012 5:50 AM, Alain Ketterlin wrote: gry writes: sys.version --> '2.6 (r26:66714, Feb 21 2009, 02:16:04) \n[GCC 4.3.2 [gcc-4_3-branch revision 141291]] I thought this script would be very lean and fast, but with a large value for n (like 15), it uses 26G of virtural memory, and

Re: str.isnumeric and Cuneiforms

2012-05-17 Thread Terry Reedy
On 5/17/2012 8:50 PM, Steven D'Aprano wrote: On Thu, 17 May 2012 21:32:29 +0200, Marco wrote: Is it normal the str.isnumeric() returns False for these Cuneiforms? '\U00012456' '\U00012457' '\U00012432' '\U00012433' They are all in the Nl category. Are you sure about that? Do you have a refe

Re: Doctest documentation?

2012-05-20 Thread Terry Reedy
On 5/20/2012 12:33 PM, Vincent Vande Vyvre wrote: On 20/05/12 17:55, Steven D'Aprano wrote: Is this a bug in the doctest documentation, or is my browser broken? On this page: http://docs.python.org/library/doctest.html#option-flags-and-directives scroll down to the examples showing the doctes

Re: what do these mean

2012-05-20 Thread Terry Reedy
On 5/20/2012 1:16 PM, Ian Kelly wrote: On Sun, May 20, 2012 at 10:52 AM, e-mail mgbg25171 wrote: There's a little forth program written in python here #http://openbookproject.net/py4fun/forth/forth.py I'm struggling to understand what these lines mean. def rJnz (cod,p) : return (cod[p],p+1)[d

Re: 2.x, 3.x iOS static build: Fatal Python error: exceptions bootstrapping error.

2012-05-20 Thread Terry Reedy
On 5/20/2012 11:33 PM, angelja...@gmail.com wrote: I'm trying to embed a part of python (core+some modules) in my iOS application for internal scripting. I have not read that anyone has run under iOS yet ;-). Good luck. I started from compiling original unmodified Python source. Tried both

Re: Help doing it the "python way"

2012-05-24 Thread Terry Reedy
On 5/24/2012 4:53 PM, Duncan Booth wrote: Scott Siegler wrote: Hello, I am an experienced programmer but a beginner to python. As such, I can figure out a way to code most algorithms using more "C" style syntax. Hi, welcome to Python. I came here from C also. I am doing something now tha

Re: pygame: transparency question

2012-05-29 Thread Terry Reedy
On 5/29/2012 11:33 AM, Scott Siegler wrote: Hello, I have a surface that I load an image onto. During a collision I would like to clear out the images of both surfaces that collided and show the score. Is there a function call to clear a surface with an image? One way I was thinking was to fi

Re: python3 raw strings and \u escapes

2012-05-30 Thread Terry Reedy
On 5/30/2012 2:52 AM, ru...@yahoo.com wrote: In python2, "\u" escapes are processed in raw unicode strings. That is, ur'\u3000' is a string of length 1 consisting of the IDEOGRAPHIC SPACE unicode character. That surprised me until I rechecked the fine manual and found: "When an 'r' or 'R' pre

Re: installing modules in Enthought Python

2012-05-30 Thread Terry Reedy
On 5/30/2012 11:05 AM, Chuck wrote: I just downloaded Enthought Python, free version. I wanted all the included packages, but I can't seem to find the correct directory to install new Python modules. Does anybody have an idea? I am trying to add Universal Feed Parser to Enthought. I have trie

Re: Tkinter deadlock on graceful exit

2012-05-30 Thread Terry Reedy
On 5/30/2012 6:19 PM, Matteo Landi wrote: On May/28, Matteo Landi wrote: Hi list, recently I started to work on an application [1] which makes use of the Tkinter module to handle interaction with the user. Simply put, the app is a text widget displaying a file filtered by given criteria, with a

Re: reading txt file

2012-05-31 Thread Terry Reedy
On 5/31/2012 11:02 AM, Ahmed, Shakir wrote: When you want to start a new thread, make sure you start a new thread and do not post as a response to another thread. This will get lost as a response to 'How to suppress ...'. Is this a homework, hobby, or work exercise? I am trying to read a tx

Re: CPython 2.7: Weakset data changing size during internal iteration

2012-06-01 Thread Terry Reedy
On 6/1/2012 11:23 AM, Temia Eszteri wrote: I've got a bit of a problem - my project uses weak sets in multiple areas, the problem case in particular being to indicate what objects are using a particular texture, if any, so that its priority in OpenGL can be adjusted to match at the same time as i

Re: CPython 2.7: Weakset data changing size during internal iteration

2012-06-01 Thread Terry Reedy
On 6/1/2012 7:40 PM, Temia Eszteri wrote: Given that len(weakset) is defined (sensibly) as the number of currently active members, it must count. weakset should really have .__bool__ method that uses any() instead of sum(). That might reduce, but not necessarily eliminate your problem. Think i

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread Terry Reedy
On 6/4/2012 11:35 AM, David Shi wrote: Please post plain text rather than html. It just works better and is the convention for this newsgroup and mailing list. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I get the constructor signature for built-in types?

2012-06-05 Thread Terry Reedy
On 6/5/2012 1:19 AM, Steven D'Aprano wrote: The inspect.getargspec and getfullargspec functions allow you to extract the function call signature for Python functions and methods. This allows you to work out the constructor signature for pure-Python classes, by calling inspect.getargspec on the __

Re: ttk.Spinbox missing?

2012-06-06 Thread Terry Reedy
On 6/6/2012 9:06 AM, Mark Summerfield wrote: I have Python 3.2 with Tcl/Tk 8.5, but there doesn't seem to be a ttk.Spinbox widget even though that widget is part of Tcl/Tk 8.5: http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_spinbox.htm Why is that? My guess is that Spinbox was not present when tkinte

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-06 Thread Terry Reedy
On 6/6/2012 4:56 PM, Jerry Hill wrote: On Wed, Jun 6, 2012 at 4:10 PM, Alec Ross wrote: FWIW, English idiomatic usage includes "see overleaf", and "see over", for the obverse side of a page/sheet, i.e, the following page; and "see facing page", w/ the obvious meaning. For what it's worth, I'v

Re: Python libraries portable?

2012-06-08 Thread Terry Reedy
On 6/8/2012 4:09 AM, Alister wrote: On Thu, 07 Jun 2012 20:20:47 +, jkells wrote: We are new to developing applications with Python. A question came up concerning Python libraries being portable between Architectures. More specifically, can we take a python library that runs on a X86 archi

Re: Strange Problem with pythonw.exe

2012-06-09 Thread Terry Reedy
On 6/9/2012 10:23 AM, a...@vorsicht-bissig.de wrote: Hello subscribers, I've recently encountered a strange problem with Python for Windows. I'm using Windows 7 Pro 64 Bit and Python 3.2.3 64 Bit (also tried 32 bit). The Problem is, that pythonw.exe does not work at all! Therefore no IDLE for me

Re: mode for file created by open

2012-06-09 Thread Terry Reedy
On 6/9/2012 10:08 AM, Devin Jeanpierre wrote: On Sat, Jun 9, 2012 at 7:42 AM, Neal Becker wrote: Doesn't anyone else think it would be a good addition to open to specify a file creation mode? Like posix open? Avoid all these nasty workarounds? I do, although I'm hesitant, because this only

Re: mode for file created by open

2012-06-09 Thread Terry Reedy
On 6/9/2012 6:25 PM, Neal Becker wrote: Terry Reedy wrote: The original open builtin was a thin wrapper around old C's stdio.open. Open no longer has that constraint. After more discussion here, someone could open a tracker issue with a specific proposal. Keep in mind that 'mode

Re: Strange Problem with pythonw.exe

2012-06-10 Thread Terry Reedy
On 6/10/2012 7:39 PM, a...@vorsicht-bissig.de wrote: Thank you for your help. I found the problem at some other place. The registry tweaks didn't solve it. But I found the hint to look up my .idlerc folder. So the problem was entirely IDLE related (yes, it worked before). But it wasnt PyQt'S pro

Re: Pytz error: unpack requires a string argument of length 44

2012-06-13 Thread Terry Reedy
On 6/13/2012 4:55 PM, bri...@gmail.com wrote: Hi! I'm trying to get a handle on pytz (http://pytz.sourceforge.net/). I don't have root on the system I'll be running my script on, so I need to go for a local installation. I copied pytz into a folder in my sys.path and am importing from there.

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Terry Reedy
On 6/13/2012 6:45 PM, Gilles wrote: On Wed, 13 Jun 2012 23:16:31 +0200, Christian Heimes wrote: PHP was developed for non-developers. (see http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ ). It's much easier and also cheaper to find bad coders and non-developers than code peop

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

2012-06-15 Thread Terry Reedy
On 6/15/2012 1:03 PM, Tomasz Rola wrote: Last time I checked, Python didn't have linked lists - arrayed lists are nice, but their elements can't be automatically GC-ed (or, this requires very nontrivial GC algorithm), the easiest way I can think would be replacing them with None manually. I'm no

Re: Use of internal ctypes objects

2012-06-15 Thread Terry Reedy
On 6/15/2012 4:28 AM, RICHARD MOSELEY wrote: To check whether the function has been previously converted, I make use of internal objects within the ctypes module, namely, _SimpleCData and _CFuncPtr. Is this a safe thing to do, bearing in mind that the objects are documentated as internal? It d

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

2012-06-15 Thread Terry Reedy
On 6/15/2012 3:04 PM, Paul Rubin wrote: Terry Reedy writes: Python iterators can do lazy evaluation. All the builtin classes come with a corresponding iterator. ... I wouldn't say iterators do lazy evaluation in the Scheme or Haskell sense. Lazy evaluation imho means evaluation is def

Re: Academic citation of Python

2012-06-16 Thread Terry Reedy
On 6/15/2012 11:24 PM, Mark Livingstone wrote: Hello! I wish to properly cite Python in an academic paper I am writing. Is there a preferred document etc to cite? At present, I would use something like Rossum, Guido van, et al, *The Python Language Reference*, Python Software Foundation; ht

Re: Academic citation of Python

2012-06-16 Thread Terry Reedy
On 6/16/2012 5:01 PM, Christian Heimes wrote: Am 16.06.2012 22:44, schrieb Terry Reedy: Rossum, Guido van, et al, *The Python Language Reference*, Python Software Foundation; http://docs.python.org/py3k/reference/index.html Actually it's "van Rossum, Guido", not "Rossum,

Re: How does python bytecode works?

2012-06-17 Thread Terry Reedy
On 6/17/2012 5:54 AM, gmspro wrote: We know python is written in C. Nope. The CPython Python interpreter is written in (as portable as possible) C. The Jython, IronPython, and PyPy Python interpreters are written in Jave, C#, and Python respectively. Each compiles Python to something differe

Re: lazy evaluation of a variable

2012-06-17 Thread Terry Reedy
On 6/17/2012 5:35 PM, Gelonida N wrote: I'm having a module, which should lazily evaluate one of it's variables. If you literally mean a module object, that is not possible. On the other hand, it is easy to do with class instances, via the __getattr__ special method or via properties. At

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Terry Reedy
On 6/18/2012 12:39 PM, jmfauth wrote: We are turning in circles. You are, not we. Please stop. You are somehow legitimating the reintroduction of unicode literals We are not 'reintroducing' unicode literals. In Python 3, string literals *are* unicode literals. Other developers reintroduc

Re: module name vs '.'

2012-06-18 Thread Terry Reedy
On 6/18/2012 9:54 AM, Dave Angel wrote: On 06/18/2012 09:47 AM, Neal Becker wrote: I meant a module You are correct that using periods in a module name conflicts with periods in import statement syntax. from src.directory import neal that has nothing to do with periods being in a director

Re: Problem porting class to python3.2

2011-06-02 Thread Terry Reedy
On 6/2/2011 12:18 PM, Nick Buchholz wrote: Hi all, I've been wandering through the DOCs for an hour and haven't found a solution to this I'm just starting to convert from 2.5 to 3.2 and I have a problem. I have a code that looks like this. from tkinter import * import time import datetim

Re: Something is rotten in Denmark...

2011-06-02 Thread Terry Reedy
On 6/2/2011 7:00 AM, Alain Ketterlin wrote: Nowhere. But going against generally accepted semantics should at least be clearly indicated. Lambda is one of the oldest computing abstraction, and they are at the core of any functional programming language. Adding a quick hack to python and call it

<    2   3   4   5   6   7   8   9   10   11   >