examining python objects

2005-11-18 Thread rurpy
Is there a function/class/module/whatever I can use to look at objects? I want something that will print the object's value (if any) in pretty-printed form, and list all it's attributes and their values. And do all that recursively. I want to be able to find out everything about an object that

Re: examining python objects

2005-11-18 Thread rurpy
__repr__ almost always only prints a summary of it's object, not the detailed internal structure that I want to see. When it prints values, that are not pretty-printed, nor are the objects that constitute the value printed recursively. Writing my own __repr__() is emphatically what I don't want

Re: examining python objects

2005-11-18 Thread rurpy
Chris Mellon [EMAIL PROTECTED] wrote: On 18 Nov 2005 14:05:05 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: -- snip -- Writing my own __repr__() is emphatically what I don't want to do! That is no better than debugging by inserting print statements, a technique from the 1980's. It's

Re: examining python objects

2005-11-19 Thread rurpy
Bruno Desthuilliers wrote: [EMAIL PROTECTED] a écrit : Is there a function/class/module/whatever I can use to look at objects? I want something that will print the object's value (if any) in pretty-printed form, and list all it's attributes and their values. And do all that

Re: examining python objects

2005-11-19 Thread rurpy
Bruno Desthuilliers wrote: [EMAIL PROTECTED] a écrit : Is there a function/class/module/whatever I can use to look at objects? I want something that will print the object's value (if any) in pretty-printed form, and list all it's attributes and their values. And do all that

Re: about list

2005-11-20 Thread rurpy
Shi Mu wrote: How to run a function to make [1,2,4] become [[1,2],1,4],[2,4]]? Thanks! You want [[1,2],[1,4],[2,4]]? That is, all combinations of 2 items from the list? You might want to look at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 import * from xpermutations [x

Re: about sort and dictionary

2005-11-22 Thread rurpy
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: so what would an entry-level Python programmer expect from this piece of code? for item in a.reverse(): print item for item in a.reverse(): print item I would expect it to first print a in reverse then a as it was. a=[1,2,3]

Re: examining python objects

2005-11-22 Thread rurpy
Colin J. Williams wrote: [EMAIL PROTECTED] wrote: Bruno Desthuilliers wrote: [EMAIL PROTECTED] a écrit : Is there a function/class/module/whatever I can use to look at objects? I want something that will print the object's value (if any) in pretty-printed form, and list all it's

Re: about sort and dictionary

2005-11-22 Thread rurpy
Steven D'Aprano [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tue, 22 Nov 2005 08:53:07 -0800, rurpy wrote: I am not a complete newb at python, but I am still pretty new. I too thought immediately that the output should be 3,2,1, 1,2,3. What you are saying is that a.reverse

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-22 Thread rurpy
[EMAIL PROTECTED] wrote: ii. The other problem is easier to explain by example. Let it=iter([1,2,3,4]). What is the result of zip(*[it]*2)? The current answer is: [(1,2),(3,4)], but it is impossible to determine this from the docs, which would allow [(1,3),(2,4)] instead

Re: about sort and dictionary

2005-11-22 Thread rurpy
Mike Meyer wrote: [EMAIL PROTECTED] writes: I think this is just another (admittedly minor) case of Python's designers using Python to enforce some idea of programming style purity. You say that as if it were a bad thing. Well, there are many languages that promote a specific style of

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-22 Thread rurpy
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: * It is bug-prone -- zip(x,x) behaves differently when x is a sequence and when x is an iterator (because of restartability). Don't leave landmines for your code maintainers. Err thanks for the advice, but they are *my* code

Re: about sort and dictionary

2005-11-22 Thread rurpy
Alex Martelli wrote: [EMAIL PROTECTED] wrote: ... language, yea, I guess I think it's bad. A general purpose language should strive to support as wide a varity of styles as possible. Definitely NOT Python's core design principle, indeed the reverse of it. Priciples are fine if not

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-22 Thread rurpy
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Well, I do too mostly. On rereading my post, it seems I overreacted a bit. But the attitude I complained about I think is real, and has led to more serious flaws like the missing if-then-else expression, something I use in virtually

Re: about sort and dictionary

2005-11-22 Thread rurpy
Alex Martelli wrote: [EMAIL PROTECTED] wrote: ... language, yea, I guess I think it's bad. A general purpose language should strive to support as wide a varity of styles as possible. Definitely NOT Python's core design principle, indeed the reverse of it. Priciples are fine if not

Re: the PHP ternary operator equivalent on Python

2005-11-23 Thread rurpy
Fredrik Lundh wrote: Daniel Crespo wrote: Let me tell you something: I'm not a one-liner coder, but sometimes It is necesary. For example: I need to translate data from a DataField to Another. def Evaluate(condition,truepart,falsepart): if condition: return truepart

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-23 Thread rurpy
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: led to more serious flaws like the missing if-then-else expression, something I use in virtually every piece of code I write, and which increases readability. you obviously need to learn more Python idioms. Python works better if you use

Re: Python as Guido Intended

2005-11-23 Thread rurpy
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: it seems that quite some people don't see the language as the creator or wants them to see it. Here's my two cents on this recurring theme. While nothing forces a particular programming style, there is some

Re: about sort and dictionary

2005-11-23 Thread rurpy
Magnus Lycka wrote: [EMAIL PROTECTED] wrote: a reminder that the change is inplace. How arrogant! While I'm sure the designers had kindly intentions. my memory, though bad, is not that bad, and I object to being forced to write code that is more clunky than need be, because the

Re: the PHP ternary operator equivalent on Python

2005-11-24 Thread rurpy
Steven D'Aprano wrote: [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: def convert(old): new = dict( CODE=old['CODEDATA'], DATE=old['DATE'] ) if old['CONTACTTYPE'] == 2: new['CONTACT'] = old['FIRSTCONTACT'] else: new['CONTACT']

Re: the PHP ternary operator equivalent on Python

2005-11-24 Thread rurpy
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: I don't find your code any more readable than the OP's equivalent code: the OP's question was How you do this in a practic way without the use of one-line code ? I know. But you compared the readability of code with one-liners and

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-24 Thread rurpy
Fredrik Lundh [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: the thing that's in favour is then-if-else, not if-then-else. Sorry if I confused you, I though it was clear that I meant the concept, not a specific syntactical implementation. yup, but if you care readability about,

Re: Python as Guido Intended

2005-11-24 Thread rurpy
Mike Meyer [EMAIL PROTECTED] writes: [EMAIL PROTECTED] writes: Different programming styles are appropriate for different tasks, different times and different places, different people. And like morality, government, or economics, I do not believe that one style of programming fits all

Re: defining the behavior of zip(it, it)

2005-11-24 Thread rurpy
Alex Martelli wrote: [EMAIL PROTECTED] wrote: ... cookbook recipies of which there are already several good collections, but shorter things like, copy(sequence) is spelled sequence[:]. No way: from collections import deque d=deque([1,2,3]) d[:] Traceback (most recent call

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2005-12-04 Thread rurpy
Cameron Laird [EMAIL PROTECTED] wrote: snip Among the treasures available in The Wiki is the current copy of the Sorting min-howto: http://www.amk.ca/python/howto/sorting/sorting.html snip Why is this a treasure when it is way out of date? 1. There is no mention of the key or

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2005-12-04 Thread rurpy
Tony Meyer wrote: Among the treasures available in The Wiki is the current copy of the Sorting min-howto: http://www.amk.ca/python/howto/sorting/sorting.html Why is this a treasure when it is way out of date? Note that the updated version of this is at:

timeit's environment

2005-12-04 Thread rurpy
Why doesn't the following work? It generates a NameError: global name 'data' is not defined error. import timeit global data data = [3,8,4,8,6,0,5,7,2,1] env = global data; x = data print timeit.Timer('x.sort()', env).timeit() print timeit.Timer('x.sort(cmp=cmp', env).timeit()

Re: Bitching about the documentation...

2005-12-04 Thread rurpy
[EMAIL PROTECTED] wrote: Gee, I wonder if I typed sort into the search box on the wiki it might turn up something useful? Well, what do you know? 2 results of about 4571 pages. (0.19 seconds) 1. HowTo/Sorting 2. SortingListsOfDictionaries Are we talking about the same Search

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2005-12-04 Thread rurpy
Tony Meyer wrote: Among the treasures available in The Wiki is the current copy of the Sorting min-howto: http://www.amk.ca/python/howto/sorting/sorting.html Why is this a treasure when it is way out of date? Note that the updated version of this is at:

Re: timeit's environment

2005-12-04 Thread rurpy
Alex Martelli wrote: [EMAIL PROTECTED] wrote: Why doesn't the following work? It generates a NameError: global name 'data' is not defined error. import timeit global data data = [3,8,4,8,6,0,5,7,2,1] env = global data; x = data print timeit.Timer('x.sort()',

Re: Creating referenceable objects from XML

2005-12-04 Thread rurpy
Michael Williams wrote: Hi All, I'm looking for a quality Python XML implementation. All of the DOM and SAX implementations I've come across so far are rather convoluted. Are there any quality implementations that will (after parsing the XML) return an object that is accessible by name?

Re: Bitching about the documentation...

2005-12-04 Thread rurpy
Peter Hansen wrote: [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: snip Are we talking about the same Search box (at the top right of the wiki page, and labeled search? Well, yes I did enter sort and got (as I said) a long list of archived maillist postings. No, he's talking about

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2005-12-05 Thread rurpy
Tony Meyer [EMAIL PROTECTED] wrote: It's site:, but even if you just left that out and used 'wiki.python.org sorting how to', the first link is the one you're after. Laziness is no excuse. You miss my point. Having outdated documentaion distributed with Python is the problem. Have

Re: Bitching about the documentation...

2005-12-05 Thread rurpy
Tony Meyer [EMAIL PROTECTED] wrote: But, the standard responce of don't complain, fix it yourself is bogus too. There are plenty of people on this list willing to sing python's praises, for balance, there should be people willing to openly point out python's flaws. This makes no

Re: Bitching about the documentation...

2005-12-05 Thread rurpy
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --snip-- rurpy Well, I'm not totally sure but I think I would be willing to a rurpy least try contributing something. A large amount of the time I rurpy waste when writing Python programs is directly attributable

Re: what's wrong with lambda x : print x/60,x%60

2005-12-05 Thread rurpy
Gary Herron [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --snip-- So just use a def. It is constantly pointed out on this list that the lambda provides no extra expressive power, it is merely a shortcut No, it is not merely a shortcut. It often allows one to avoid polluting

Re: timeit's environment

2005-12-05 Thread rurpy
Scott David Daniels wrote: [EMAIL PROTECTED] wrote: Since I've been bitching about documentation in another thread, I'm curious... Would it be obvious to anyone of low to intermediate python skills that using global would not work in this case? Would it be obvious that using an

Re: Bitching about the documentation...

2005-12-05 Thread rurpy
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: I don't believe my name, etnic heritage, gender, age, employer or school, or part of the world I live in, have any bearing on the contents of my postings. perhaps not, but it's not what you think that's important here. and I sure cannot

Re: Bitching about the documentation...

2005-12-05 Thread rurpy
Paul Rubin http://[EMAIL PROTECTED] wrote: Steve Holden [EMAIL PROTECTED] writes: Or, better still, by an accomplished writer who has access to the code's author. This was indeed my experience in writing the docs for previously undocumented modules. The author was happy to help me by

Re: Bitching about the documentation...

2005-12-05 Thread rurpy
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: --snip-- If you prefer the latest documentation, bookmark this page: http://www.python.org/dev/doc/devel/index.html Thanks I will keep that in mind. But the obvious risk is that it will refer to

Re: what's wrong with lambda x : print x/60,x%60

2005-12-05 Thread rurpy
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: and, as you just found out, a rather restrictive one at that. In part because Python's designers failed to make print a function or provide an if-then-else expression. Why would one need print in lambda ? I like ternary

Re: Documentation suggestions

2005-12-06 Thread rurpy
[EMAIL PROTECTED] wrote: Ian I think it would be very useful if there was reference (not just Ian tutorial) documentation for all the syntax, special semantics like Ian magic methods, and all the functions and objects in builtins. It's pretty common to have a User's Guide as well as

Re: Documentation suggestions

2005-12-07 Thread rurpy
Michael Spencer [EMAIL PROTECTED] wrote: A.M. Kuchling wrote: On Tue, 06 Dec 2005 10:29:33 -0800, Michael Spencer [EMAIL PROTECTED] wrote: not that helpful. Miscellaneous Services, in particular, gives no clue to treasures it contains. I would prefer, for example, to see the data

Re: Documentation suggestions

2005-12-07 Thread rurpy
Adam Olsen wrote: On 12/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Adam I don't expect everything to make the transition. Are discussions Adam of atoms and fragments of BNF really better than calling them Adam expressions and linking to CPython's Grammar file?

Re: Documentation suggestions

2005-12-07 Thread rurpy
[EMAIL PROTECTED] wrote: The library reference has so many modules that the table of contents is very large. Again, not really a problem that we can fix; splitting it up into separate manuals doesn't seem like it would help. Iain I like the Global Module Index in

Re: Documentation suggestions

2005-12-07 Thread rurpy
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: The builtins section should be moved to the language reference manual. The material it documents is part of the language definition, not part of an add-on library. the standard library is not an add-on. you're confused. /F Your probably

Re: ElementTree - Why not part of the core?

2005-12-07 Thread rurpy
Steven Bethard wrote: --snip-- I think some people were hoping that instead of adding these things to the standard library, we would come up with a better package manager that would make adding these things to your local library much simpler. STeVe

Re: Documentation suggestions

2005-12-07 Thread rurpy
[EMAIL PROTECTED] wrote: Ian I think the point is that there is the core language, and from a Ian user's perspective builtins and statements and syntax are all the Ian same thing. When you import a module, it's more-or-less obvious Ian where you find information about the module

Re: Documentation suggestions

2005-12-07 Thread rurpy
Fredrik Lundh wrote: Ian Bicking wrote: the standard library is not an add-on. you're confused. I think the point is that there is the core language, and from a user's perspective builtins and statements and syntax are all the same thing. When you import a module, it's more-or-less

itertools.izip brokeness

2006-01-03 Thread rurpy
The code below should be pretty self-explanatory. I want to read two files in parallel, so that I can print corresponding lines from each, side by side. itertools.izip() seems the obvious way to do this. izip() will stop interating when it reaches the end of the shortest file. I don't know how

Re: itertools.izip brokeness

2006-01-03 Thread rurpy
[EMAIL PROTECTED] wrote: But that is exactly the behaviour of python iterator, I don't see what is broken. izip/zip just read from the respectives streams and give back a tuple, if it can get one from each, otherwise stop. And because python iterator can only go in one direction, those

Re: itertools.izip brokeness

2006-01-03 Thread rurpy
Duncan Booth [EMAIL PROTECTED] wrote: Peter Otten wrote: from itertools import izip, chain, repeat def prt_files (file1, file2): file1 = chain(file1, repeat()) file2 = chain(file2, repeat()) for line1, line2 in iter(izip(file1, file2).next, (, )): print

Re: itertools.izip brokeness

2006-01-03 Thread rurpy
holes in it. I spend WAY too much time trying to figure out how to do something that should be easy, but isn't because someone thought that it might hurt the purity of the language or violate some principle. pissed-offedly-yr's, rurpy FLAME OFF -- http://mail.python.org/mailman/listinfo/python

Re: itertools.izip brokeness

2006-01-04 Thread rurpy
Raymond Hettinger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: izip's uses can be partitioned two ways: 1. All iterables have equal lengths 2. Iterables have different lengths. Case 1 is no problem obviously. In Case 2 there are two sub-cases:

Re: itertools.izip brokeness

2006-01-04 Thread rurpy
I don't understand this. Why do you need look ahead? Just before I posted, I got it (I think) but didn't want to rewrite everything. The need for unget() (or peek(), etc) is to fix the thrown-away-data problem in izip(), right? As an easier alternative, what about leaving izip() alone and

Re: itertools.izip brokeness

2006-01-05 Thread rurpy
Bengt Richter wrote: On 5 Jan 2006 15:48:26 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: On 2006-01-04, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: But here is my real question... Why isn't something like this in itertools, or why shouldn't it go into itertools?

Re: pdb.py - why is this debugger different from all other debuggers?

2006-01-05 Thread rurpy
R. Bernstein [EMAIL PROTECTED] wrote: Okay, a bit of an exaggeration. Recently, I've been using Python more seriously, and in using the debugger I think one of the first things I noticed was that there is no restart (R in perldb) or run (gdb) command. I was pleasantly pleased discover how

Re: Microsoft IronPython?

2006-01-05 Thread rurpy
EP wrote: Luis M. González wrote: Will Microsoft hurt Python? I think it is naive to ignore the fact that Microsoft could hurt Python, though there may be nothing anyone can do. How? - create a more prevalent version of Python that is less Pythonic or undermines some of the

Re: pdb.py - why is this debugger different from all other debuggers?

2006-01-05 Thread rurpy
[EMAIL PROTECTED] wrote: Mike I don't use pdb a lot either - and I write a *lot* of Python. Ditto. I frequently just insert prints or enable cgitb. Sometimes I enable line tracing for a specific function and the functions it calls using a tracing decorator. There are lots of things that

Re: itertools.izip brokeness

2006-01-05 Thread rurpy
Michael Spencer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Bengt Richter wrote: ... from itertools import repeat, chain, izip it = iter(lambda z=izip(chain([3,5,8],repeat(Bye)), chain([11,22],repeat(Bye))):z.next(), (Bye,Bye)) for t in it: print t ... (3,

Re: Xah's Edu Corner: the bug-reporting attitude

2006-01-06 Thread rurpy
Tim Roberts [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Xah Lee (1) is a write-only poster who pontificates but never reads replies, and (2) cares not a whit that the rest of us believe him to be a moron. I find him offensive, and a pontificator as you said, but I don't think

Re: Xah's Edu Corner: the bug-reporting attitude

2006-01-06 Thread rurpy
Tim Roberts [EMAIL PROTECTED] wrote: Xah Lee (1) is a write-only poster who pontificates but never reads replies, and (2) cares not a whit that the rest of us believe him to be a moron. I find him offensive, and a pontificator as you said, but I don't think he is a moron. He has complained

Re: Microsoft IronPython?

2006-01-06 Thread rurpy
EP [EMAIL PROTECTED] wrote: Luis M. González wrote: Will Microsoft hurt Python? I think it is naive to ignore the fact that Microsoft could hurt Python, though there may be nothing anyone can do. How? - create a more prevalent version of Python that is less Pythonic or undermines

Re: Xah's Edu Corner: the bug-reporting attitude

2006-01-06 Thread rurpy
Tim Roberts [EMAIL PROTECTED] wrote: Xah Lee (1) is a write-only poster who pontificates but never reads replies, and (2) cares not a whit that the rest of us believe him to be a moron. I find him offensive, and a pontificator as you said, but I don't think he is a moron. He has complained

Re: Converting milliseconds to human time

2006-01-07 Thread rurpy
Max Erickson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] the hard way(in that you have to do it yourself): def prntime(ms): s=ms/1000 m,s=divmod(s,60) h,m=divmod(m,60) d,h=divmod(h,24) return d,h,m,s Or abstracted... def decd (n, base): Decompose numeric

Re: Xah's Edu Corner: the bug-reporting attitude

2006-01-07 Thread rurpy
Apoologies for the multiple posts -- please blame Google. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-08 Thread rurpy
Fredrik Lundh wrote: ...snip... afaik, the Python Language Reference never defines the word reference. It carefully defines words like object and value, though, and terms like call by object or call by object reference are perfectly understandable if you use the words as they are defined in

Re: Real-world use cases for map's None fill-in feature?

2006-01-09 Thread rurpy
Raymond Hettinger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Proposal I am gathering data to evaluate a request for an alternate version of itertools.izip() with a None fill-in feature like that for the built-in map() function: map(None, 'abc', '12345') #

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-09 Thread rurpy
Anton Vredegoor [EMAIL PROTECTED] wrote: ... I already sent some reply via google, got a server error, resent, got a confirmation that my message was posted, but it doesn't show up and also there's no way to retrieve my message except fishing in the cache? Yesterday I had a post not showing

Re: Is 'everything' a refrence or isn't it?

2006-01-09 Thread rurpy
Fredrik Lundh [EMAIL PROTECTED] wrote: ...snip... afaik, the Python Language Reference never defines the word reference. It carefully defines words like object and value, though, and terms like call by object or call by object reference are perfectly understandable if you use the words as

Re: Real-world use cases for map's None fill-in feature?

2006-01-09 Thread rurpy
Raymond Hettinger [EMAIL PROTECTED] wrote: Duncan Booth wrote: One example of padding out iterators (although I didn't use map's fill-in to implement it) is turning a single column of items into a multi-column table with the items laid out across the rows first. The last row may have to

Re: Is 'everything' a refrence or isn't it?

2006-01-09 Thread rurpy
Donn Cave [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Quoth [EMAIL PROTECTED]: | Fredrik Lundh wrote: | ...snip... | afaik, the Python Language Reference never defines the word reference. | It carefully defines words like object and value, though, and terms like | call by

another docs problem - imp

2006-01-09 Thread rurpy
Another Python docs problem... I was trying to use imp.find_module(). imp.find_module(mymod, ./subdir) ImportError: No frozen submodule named ./subdir.mymod subdir/mymod.py definately exists, has reasonable permissions, etc. After a lot of reading and re-reading the docs, trying various

Re: another docs problem - imp

2006-01-09 Thread rurpy
Tony Meyer wrote: [EMAIL PROTECTED] Another Python docs problem... I was trying to use imp.find_module(). [...] I saw not a hint of this in the docs. In fact they seem to say that the first (unworking) form *should* work. Bye bye about two hours altogether... I thought I

Re: Real-world use cases for map's None fill-in feature?

2006-01-10 Thread rurpy
Raymond Hettinger [EMAIL PROTECTED] wrote: History of zip() PEP 201 (lock-step iteration) documents that a fill-in feature was contemplated and rejected for the zip() built-in introduced in Py2.0. In the years before and after, SourceForge logs show no requests for

Re: another docs problem - imp

2006-01-10 Thread rurpy
Fredrik Lundh [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Turns out that you have to do imp.find_module(mymod, [./subdir]) I saw not a hint of this in the docs. In fact they seem to say that the first (unworking) form *should* work. from the find_module documentation:

Re: Is 'everything' a refrence or isn't it?

2006-01-12 Thread rurpy
Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: afaik, the Python Language Reference never defines the word reference. It carefully defines words like object and value, though, and terms like call by object or call by object

Re: another docs problem - imp

2006-01-13 Thread rurpy
Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: from the find_module documentation: find_module( name[, path]) Try to find the module _name_ on the search path _path_. If _path_ is a list of directory names,

Re: Real-world use cases for map's None fill-in feature?

2006-01-13 Thread rurpy
Raymond Hettinger [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] How well correlated in the use of map()-with-fill with the (need for) the use of zip/izip-with-fill? [raymond] Close to 100%. A non-iterator version of izip_longest() is exactly equivalent to map(None, it1, it2, ...).

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread rurpy
Donn Cave [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Donn Cave [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ... So you've had time to think about how you would define value, in a few words. Any ideas? Not yet. The reason is

Re: More than you ever wanted to know about objects [was: Is everything a refrence or isn't it]

2006-01-22 Thread rurpy
Steve Holden wrote: [...snipped a long and very helpful post addressing some questions I had regarding the nature of an object's value in python...] Sorry for the belated reply Steve (I had some access problems) but did want to let you know I found that post very informative, and wanted to thank

Re: another docs problem - imp

2006-01-22 Thread rurpy
Steve Holden wrote: [EMAIL PROTECTED] wrote: [...snip...] Well, perhaps if you'd read the intro to the documentation (more carefully), or if you were more used to reading programming manuals, you'd quickly have recognised [, path] as meaning precisely that the path argument is

Re: Real-world use cases for map's None fill-in feature?

2006-01-23 Thread rurpy
Andrae Muys [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I am still left with a difficult to express feeling of dissatifaction at this process. Plese try to see it from the point of view of someone who it not a expert at Python: Here is izip(). My conception is it takes two

Re: Real-world use cases for map's None fill-in feature?

2006-01-23 Thread rurpy
Andrae Muys wrote: [EMAIL PROTECTED] wrote: Thank you for the posting Andrae, it has increased my knowledge. No problem, happy to help. But my original point was there are cases (often involving file iterators) where the problem's complexity seems to be on the same order as problems

elementtree and entities

2008-03-17 Thread rurpy
I need to parse little snipits of xml that come from a file that has a large DTD that defines hundreds or entities. But when these snipits are parsed (with elementtree.XML()) without the DTD, the entities are undefined and cause a parse failure. Is there any way to tell elementtree to not fail on

Re: Regular Expression Help

2009-04-11 Thread rurpy
On Apr 11, 9:42 pm, Jean-Claude Neveu jcn-france1...@pobox.com wrote: My regexp that I'm matching against is: ^\$\£?\d{0,10}(\.\d{2})?$ Here's how I think it should work (but clearly I'm wrong, because it does not actually work): ^\$\£? Require zero or one instance of $ or £ at the

Re: python's setuptools (eggs) vs ruby's gems survey/discussion

2008-06-01 Thread rurpy
On Jun 1, 2:47 am, Alia Khouri [EMAIL PROTECTED] wrote: Can we open up the discussion here about how to improve setuptools which has become the de facto standard for distributing / installing python software. I've been playing around with ruby's gems which seems to be more more mature and

Re: Checking each item in m.group()?

2008-06-02 Thread rurpy
[EMAIL PROTECTED] wrote: On Jun 2, 5:06 pm, Peter Otten [EMAIL PROTECTED] wrote: You are taking the wrong approach here. Don't build SQL statements as strings; you are enabling the next SQL injection attack. Pass parameters using the DB API instead. Don't use regular expressions to parse a

Re: parser recommendation

2008-06-03 Thread rurpy
On Jun 3, 2:55 pm, Filipe Fernandes [EMAIL PROTECTED] wrote: I haven't given up on pyparsing, although I'm now heavily leaning towards PLY as an end solution since lex and yacc parsing is available on other platforms as well. Keep in mind that PLY's compatibility with YACC is functional, not

Re: how to convert '8868' to u'\u8868'

2008-06-24 Thread rurpy
On Jun 24, 7:30 pm, CodeHunter [EMAIL PROTECTED] wrote: a = '8868' b = u'\u8868' I want to convert a to b who can help me ? thank you very much! a='8868' unichr(int(a,16)) u'\u8868' -- http://mail.python.org/mailman/listinfo/python-list

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

2007-12-20 Thread rurpy
On Dec 20, 6:35 am, Benoit [EMAIL PROTECTED] wrote: I understand that the Win32 has been said to be itself poorly documented, so perhaps that the documentation that comes with the modules is of similar quality is no coincidence. Maybe I'm still too young in my programming to grasp the good of

Re: How to ignore the first line of the text read from a file

2008-08-28 Thread rurpy
On Aug 27, 11:12 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 27 Aug 2008 21:11:26 -0700, [EMAIL PROTECTED] wrote: I want to read text line-by-line from a text file, but want to ignore only the first line. I know how to do it in Java (Java has been my primary language for

Python equivalent of Perl-ISAPI?

2006-03-17 Thread rurpy
Is there an effcient way (more so than cgi) of using Python with Microsoft IIS? Something equivalent to Perl-ISAPI? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python equivalent of Perl-ISAPI?

2006-03-20 Thread rurpy
Waldemar Osuch wrote: What Roger says and also: http://pyisapie.sourceforge.net/ Thanks for your and Roger's responses. I looked at pyisapie and there seems to be almost no dvcumentation -- no sample code and the single readme is pretty opaque.The pywin isapi has a couple of examples but

Re: Python equivalent of Perl-ISAPI?

2006-03-20 Thread rurpy
Steve Holden wrote: If you want CGI then there's no need for an ISAPI filter specific to your programming language - you just need to associate .py requests with the Python interpreter. If you want to use Python as an Active Scripting language (i.e. in the same way that VBScript is used)

Re: Python equivalent of Perl-ISAPI?

2006-03-20 Thread rurpy
Atanas Banov wrote: [EMAIL PROTECTED] wrote: Steve Holden wrote: [EMAIL PROTECTED] wrote: Pure cgi is too slow. Active Scripting means ASP, yes? I need something that will do cgi scripts (a lot of which I already have and can modify but don't want to rewrite extensively,

Re: Python equivalent of Perl-ISAPI?

2006-03-20 Thread rurpy
Atanas Banov wrote: [EMAIL PROTECTED] wrote: Steve Holden wrote: [EMAIL PROTECTED] wrote: Pure cgi is too slow. Active Scripting means ASP, yes? I need something that will do cgi scripts (a lot of which I already have and can modify but don't want to rewrite extensively,

Re: Python equivalent of Perl-ISAPI?

2006-03-22 Thread rurpy
[EMAIL PROTECTED] wrote: Atanas Banov wrote: [EMAIL PROTECTED] wrote: Steve Holden wrote: [EMAIL PROTECTED] wrote: Pure cgi is too slow. Active Scripting means ASP, yes? I need something that will do cgi scripts (a lot of which I already have and can modify but

Re: Why class exceptions are not deprecated?

2006-03-22 Thread rurpy
Fredrik Lundh wrote: Gregory Petrosyan wrote: 1) From 2.4.2 documentation: There are two new valid (semantic) forms for the raise statement: raise Class, instance raise instance 2) In python: raise NameError Traceback (most recent call last): File stdin, line 1, in ?

Doc suggestions (was: Why class exceptions are not deprecated?)

2006-03-28 Thread rurpy
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: The OP points out an ambiguity in the docs, and as usual, gets told he can't read, etc. How typical. where did anyone tell the OP that he can't read? it could be that the tutorial author expected you to read chapter 8 before you read

  1   2   3   4   5   6   >