Does Running Python modules dump stuff on "C" drive?

2006-06-19 Thread Warren
ed. Some of it I can find some not. So until I can get a new HD I need to keep weeding out the weeds! TIA. Warren -- http://mail.python.org/mailman/listinfo/python-list

Rollover/wraparound time of time.clock() under win32?

2005-09-28 Thread Russell Warren
Does anyone know how long it takes for time.clock() to roll over under win32? I'm aware that it uses QueryPerformanceCounter under win32... when I've used this in the past (other languages) it is a great high-res 64-bit performance counter that doesn't roll-over for many (many) years, but I'm worr

Re: Rollover/wraparound time of time.clock() under win32?

2005-09-28 Thread Russell Warren
Thanks! That gets me exactly what I wanted. I don't think I would have been able to locate that code myself. Based on this code and some quick math it confirms that not only will the rollover be a looong way out, but that there will not be any loss in precision until ~ 30 years down the road. C

scope of socket.setdefaulttimeout?

2005-09-29 Thread Russell Warren
Does anyone know the scope of the socket.setdefaulttimeout call? Is it a cross-process/system setting or does it stay local in the application in which it is called? I've been testing this and it seems to stay in the application scope, but the paranoid side of me thinks I may be missing something

Threads and socket.setdefaulttimeout

2005-10-12 Thread Russell Warren
It appears that the timeout setting is contained within a process (thanks for the confirmation), but I've realized that the function doesn't play friendly with threads. If I have multiple threads using sockets and one (or more) is using timeouts, one thread affects the other and you get unpredicta

Re: Threads and socket.setdefaulttimeout

2005-10-19 Thread Russell Warren
Thanks for the detailed repsone... sorry for the lag in responding to it. After reading and further thought, the only reason I was using setdefaulttimeout in the first place (rather then using a direct settimeout on the socket) was because it seemed like the only way (and easy) of getting access t

Any royal road to Bezier curves...?

2005-11-20 Thread Warren Francis
what I want after all? Any thoughts would be much appreciated. I've got some ideas I want to test, but if I can't find a simple implementation of curves, I'm going to get so bogged down in trying to do that part, I'll never get to what I'm excited about. :-P Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: Any royal road to Bezier curves...?

2005-11-22 Thread Warren Francis
ut I'm new enough to this that I'd benefit greatly from an couple of lines of example code, implementing your classes... how do I go from a set of coordinates to a Natural Cubic Spline, using your python code? Thanks for all the help, everybody! Warren "Tom Anderson" <[E

Re: Any royal road to Bezier curves...?

2005-11-22 Thread Warren Francis
> If you go right to the foot of my code, you'll find a simple test routine, > which shows you the skeleton of how to drive the code. Oops... my request just got that much more pitiful. :-) Thanks for the help. Warren -- http://mail.python.org/mailman/listinfo/python-list

DbfilenameShelf instance has no attribute 'writeback'

2005-01-20 Thread warren ali
Anyone have any idea why this is failing with the following error class _IndexFile: """An _IndexFile is an implementation class that presents a Sequence and Dictionary interface to a sorted index file.""" def __init__(self, pos, filenameroot): self.pos = pos self.file = open(_indexFilePathname(fi

what is your opinion of zope?

2005-06-26 Thread Avery Warren
I am investigating converting a wiki site to plone. I am having a lot of difficulty finding good documentation programmatically accessing the ZODB API. A lot of the user feedback is centered on how difficult it is to get good documentation on developing using these technologies. My question to com

Re: what is your opinion of zope?

2005-06-28 Thread Avery Warren
The real problem is that the version of wiki we currently use doesn't support any concept of workflow. That is fine for the company now but as it matures in its processes, a more mature solution will become more and more compelling. Various solutions include... 1. The current wiki implementati

Re: Faster way to do this...

2005-03-01 Thread Warren Postma
ambda. ... Wait, actually, I'm not out of that yet. :-) Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 removes None data type?

2005-03-04 Thread Warren Postma
litches LEFT in Python? Now go look at Perl and come back and say "Thank-deity-of-my-choice-I'm-using-Python". Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: shuffle the lines of a large file

2005-03-07 Thread Warren Postma
g a database of the file, keep the raw text file for sure, but create a converted copy in bsddb or pytables format. Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: intigrate the PyGame module with my Python

2005-03-07 Thread Warren Postma
1. Downloaded the windows binary for python 1.5.2 from python.org. Pygame uses Python 1.5.2 still!? :-) Oi. Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 removes None data type?

2005-03-07 Thread Warren Postma
Michael Hoffman wrote: The fact that True and False are not constants? Yowza. a = True b = False False = a True = b if (1==2)==True: print "Doom" -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 removes None data type?

2005-03-07 Thread Warren Postma
Michael Hoffman wrote: The fact that True and False are not constants? Yowza. a = True b = False False = a True = b if (1==2)==True: print "Doom" -- http://mail.python.org/mailman/listinfo/python-list

ADO, Python and MS Exchange

2004-12-23 Thread warren ali
Hi all! I'm new to python and I seem to have a hit a of a brick wall. I hope you guys can help. I'm trying to rewrite some of my vbscripts in python. This particular script connects to a mailbox in MS Exchange via ADO and calculates the mailbox size. I seem to have run into a couple of issues get

Re: boring the reader to death (wasRe: Lambda: the Ultimate DesignFlaw

2005-04-05 Thread Warren Postma
, I am more able to pick it up and work with it than I am with other less agile languages. I'm not merely talking about pedantic details of literal code-readability, I'm talking about the ability to intuit design from implementation, and the orthogonality of the design of the system to

Re: Testing threading

2005-04-07 Thread Warren Postma
ngs could go wrong ("What happens if the data isn't here or is invalid?"/"Where should I be catching exceptions and how should I be handling them?") Regards, Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: cross platform printing

2005-04-07 Thread Warren Postma
cygwin batch file that prints using ghostscript. Regards, Warren -- http://mail.python.org/mailman/listinfo/python-list

Whither python24.dll? {WinCvs 2.0 and Python}

2005-04-12 Thread Warren Postma
It seems that WinCvs needs a python??.dll runtime but that when I install Python2.4 it doesn't include this dll. Python 2.3 does. What's the recommendation here? Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: Islam is not a Religion of Extremism

2014-06-22 Thread Warren Post
oogle Gropes user and would prefer not to see more of this, try: http://twovoyagers.com/improve-usenet.org/ -- Warren Post https://warrenpost.wordpress.com/ -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: usenet reader software

2014-07-18 Thread Warren Post
the latter for its great filtering. I too have had stability problems with Pan, but compiling from source fixed that for me. -- Warren Post https://warrenpost.wordpress.com/ -- https://mail.python.org/mailman/listinfo/python-list

Implied instance attribute creation when referencing a class attribute

2006-01-16 Thread Russell Warren
I just ran across a case which seems like an odd exception to either what I understand as the "normal" variable lookup scheme in an instance/object heirarchy, or to the rules regarding variable usage before creation. Check this out: >>> class foo(object): ... I = 1 ... def __init__(self): ...

Re: Implied instance attribute creation when referencing a class attribute

2006-01-16 Thread Russell Warren
> I can see how this can be confusing, but I think the confusion here is > yours, not Pythons ;) This is very possible, but I don't think in the way you describe! > self.I += 10 is an *assignment*. Like any assignment, it causes the > attribute in question to be created ... no it isn't. The +=

Re: Implied instance attribute creation when referencing a class attribute

2006-01-16 Thread Russell Warren
D'oh... I just realized why this is happening. It is clear in the longhand as you say, but I don't think in the way you descibed it (or I'm so far gone right now I have lost it). self.I += 1 is the same as self.I = self.I + 1 and when python tries figures out what the 'self.I' is on the ri

Re: Implied instance attribute creation when referencing a class attribute

2006-01-16 Thread Russell Warren
Thanks for the additional examples, David (didn't see this before my last post). All of it makes sense now, including those examples. Russ -- http://mail.python.org/mailman/listinfo/python-list

How to convert arbitrary objects directly to base64 without initial string conversion?

2006-07-13 Thread Russell Warren
I've got a case where I want to convert binary blocks of data (various ctypes objects) to base64 strings. The conversion calls in the base64 module expect strings as input, so right now I'm converting the binary blocks to strings first, then converting the resulting string to base64. This seems h

Re: How to convert arbitrary objects directly to base64 without initial string conversion?

2006-07-13 Thread Russell Warren
> Many functions that operate on strings also accept buffer objects as > parameters, > this seems also be the case for the base64.encodestring function. ctypes > objects > support the buffer interface. > > So, base64.b64encode(buffer(ctypes_instance)) should work efficiently. Thanks! I have ne

Re: How to convert arbitrary objects directly to base64 without initial string conversion?

2006-07-13 Thread Russell Warren
After some digging around it appears there is not a tonne of documentation on buffer objects, although they are clearly core and ancient... been sifting through some hits circa 1999, long before my python introduction. What I can find says that buffer is deprecated (Python in a Nutshell), or non-e

Intermittent "permission denied" errors when using os.rename and a recently deleted path??

2006-07-26 Thread Russell Warren
I've been having a hard time tracking down a very intermittent problem where I get a "permission denied" error when trying to rename a file to something that has just been deleted (on win32). The code snippet that gets repeatedly called is here: ... if os.path.exists(oldPath): os.remove(o

Re: Threads vs Processes

2006-07-26 Thread Russell Warren
> Another issue is the libraries you use. A lot of them aren't > thread safe. So you need to watch out. This is something I have a streak of paranoia about (after discovering that the current xmlrpclib has some thread safety issues). Is there a list maintained anywhere of the modules that are are

Re: Threads vs Processes

2006-07-26 Thread Russell Warren
Oops - minor correction... xmlrpclib is fine (I think/hope). It is SimpleXMLRPCServer that currently has issues. It uses thread-unfriendly sys.exc_value and sys.exc_type... this is being corrected. -- http://mail.python.org/mailman/listinfo/python-list

Re: Intermittent "permission denied" errors when using os.rename and a recently deleted path??

2006-07-26 Thread Russell Warren
> Are you running a background file accessing tool like Google Desktop > Search or an anti-virus application? If so, try turning them off as a test. I'm actually running both... but I would think that once os.remove returns that the file is actually gone from the hdd. Why would either applica

Re: Intermittent "permission denied" errors when using os.rename and a recently deleted path??

2006-07-27 Thread Russell Warren
> Does it actually tell you the target is the problem? I see an > "OSError: [Errno 17] File exists" for that case, not a permission error. > A permission error could occur, for example, if GDS has the source open > or locked when you call os.rename. No it doesn't tell me the target is the issu

Why do this?

2006-10-05 Thread Matthew Warren
Ok, not really python focused, but it feels like the people here could explain it for me :) Now, I started programming when I was 8 with BBC Basic. I never took any formal classes however, and I have never become an expert programmer. I'm an average/hobbyist programmer with quite a few languages

RE: Why do this?

2006-10-05 Thread Matthew Warren
> > | Now, I started programming when I was 8 with BBC Basic. > > Hey, likewise! (Except I was 12 when it came out!) I think it came out before I was 8, and I started out with print and input. Not sure if that's 'real' programming - I don't think I graduated to ifs and thens and gotos and gosubs

RE: Why do this?

2006-10-05 Thread Matthew Warren
> Also, having a variable of type str called 'number' seems > perverse (and > probably error prone), so I suspect I might need something like: > And not something I would normally do, but for hastily written contrived examples I might :) >print "There are "+str(number)+" ways to skin a "

RE: Why do this?

2006-10-05 Thread Matthew Warren
> Duncan Booth wrote: > > > print "There are"+number+"ways to skin a"+furryanimal > > > > or at least something equivalent to it. If I try to make > the same mistake > > with a format string it jumps out to me as wrong: > > > > "There are%sways to skin a%s" % (number, furryanimal) > > Relate

RE: Why do this?

2006-10-05 Thread Matthew Warren
> [Matthew Warren] > > | Blame outlook and AutoCaps. If number were a number I would write > | > | print "There are",number,"ways to skin a "+furryanimal > > You see now that strikes me as a bit mixed up. Why not simply use? > > print "a"

RE: dictionary of list from a file

2006-10-05 Thread Matthew Warren
> -> > Python 2.5 introduced a dictionary type with automatic > > creation of values, > > ala Perl: > > > > === > > from collections import defaultdict > > > > d = defaultdict(list) > > for line in fl: > > k, v = line.strip().split() > > d[k].append(v

RE: dictionary of list from a file

2006-10-05 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Giovanni Bajo > Sent: 04 October 2006 15:17 > To: python-list@python.org > Subject: Re: dictionary of list from a file > > [EMAIL PROTECTED] wrote: > > > while(){ > > @info=split

RE: building strings from variables

2006-10-05 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Gal Diskin > Sent: 05 October 2006 16:01 > To: python-list@python.org > Subject: building strings from variables > > Following a discussion with an associate at work about various ways to > b

Using twisted, not telnetlib for interactive telnet (WAS: RE: Improving telnetlib)

2006-10-06 Thread Matthew Warren
> >The trouble is, I havent got a clue where to start and would > appreciate > >a couple of pointers to get me going... > > > > I'd suggest taking a look at Twisted, which contains a more complete > telnet implementation (not as important for being able to launch vi), > an ssh implementation (

Funky file contents when os.rename or os.remove are interrupted

2006-10-10 Thread Russell Warren
I've got a case where I'm seeing text files that are either all null characters, or are trailed with nulls due to interrupted file access resulting from an electrical power interruption on the WinXP pc. In tracking it down, it seems that what is being interrupted is either os.remove(), or os.renam

Bad Code (that works) help me re-write!

2006-10-11 Thread Matthew Warren
I have the following piece of code, taken from a bigger module, that even as I was writing I _knew_ there were better ways of doing it, using a parser or somesuch at least, but learning how wasn't as fun as coding it... And yes alarm bells went off when I found myself typing eval(), and I'm sure th

RE: Bad Code (that works) help me re-write!

2006-10-11 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Giles Brown > Sent: 11 October 2006 12:38 > To: python-list@python.org > Subject: Re: Bad Code (that works) help me re-write! > > Matthew Warren wrote: >

Re: Funky file contents when os.rename or os.remove are interrupted

2006-10-11 Thread Russell Warren
Thanks, guys... this has all been very useful information. The machine this is happening on is already running NTFS. The good news is that we just discovered/remembered that there is a write-caching option (in device manager -> HDD -> properties -> Policies tab) available in XP. The note right b

RE: Any idea how to do this in Python?

2006-10-17 Thread Matthew Warren
> On 17 Oct 2006 02:56:45 -0700, Lad <[EMAIL PROTECTED]> wrote: > > > > Dennis, > > Thank you for your reply > > You say: > > >Pretend you are the computer/application/etc. How would YOU > > > perform such a ranking? > > That is what I do not know , how to perform such ranking. > > Do you have any

Return returns nothing in recursive function

2006-10-17 Thread Matthew Warren
Hallo people, I have the following code that implements a simple recursive tree like structure. The trouble is with the GetTreeBranch function, the print statement prints a valid value but the return immediatley afterward doesn't return anything. Can anyone help me with why? Thanks, Matt. Co

RE: Return returns nothing in recursive function

2006-10-17 Thread Matthew Warren
> break > else: > _DoThingsToTree(path[1:],value,item[path[0]],delete) > The '_' in front of DoThingsToTree shouldn't be there. That's what I get for trimming off the '_' elsewhere after I pasted the code in. Matt. This email is confidential and

RE: making a valid file name...

2006-10-18 Thread Matthew Warren
> > Hi I'm writing a python script that creates directories from user > input. > Sometimes the user inputs characters that aren't valid > characters for a > file or directory name. > Here are the characters that I consider to be valid characters... > > valid = > ':./,^0123456789abcdefghijklmno

RE: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Fredrik Lundh > Sent: 20 October 2006 06:43 > To: python-list@python.org > Subject: Re: Tkinter--does anyone use it for sophisticated > GUI development? > > Kevin Walzer wrote: > > > Comi

RE: [Tutor] How to get the width of teh button widget..??

2006-10-20 Thread Matthew Warren
    Folks,   Sorry for asking you such a trivial question.!!! But i want to size up all the buttons with the same size as the largest one in the interface.. And thats why I am asking this question..   Regards, Asrarahmed      Hi Asrarahmed.  I think, from yo

Telnetlib to twisted

2006-10-27 Thread Matthew Warren
Hallo, >>> import telnetlib >>> l=telnetlib.Telnet('dbprod') >>> l.interact() telnet (dbprod) Login: Could anyone show how the above would be written using the twisted framework? All I'm after is a more 'intelligent' interactive telnet session (handles 'vi' etc..) rather than the full capabilit

Re: Can Python format long integer 123456789 to 12,3456,789 ?

2006-06-02 Thread Warren Block
; arg = prefix + "1234567890.1234"[k:] > print "<%s> <%s>" % (arg, fmt_thousands(arg, ",")) > 8<--- Why not just port the Perl "commify" code? You're close to it, at least for the regex: # From perldoc per

Re: Installation Problem

2006-06-04 Thread Warren Block
iest way is to cvsup your ports tree and then cd /usr/ports/lang/python make make install make clean -- Warren Block * Rapid City, South Dakota * USA -- http://mail.python.org/mailman/listinfo/python-list

Recommended way to fix core python distribution issues in your own apps?

2006-06-19 Thread Russell Warren
I've got a case where I need to tweak the implementation of a default python library due to what I consider to be an issue in the library. What is the best way to do this and make an attempt to remain compatible with future releases? My specific problem is with the clock used in the threading.Eve

Is Queue.Queue.queue.clear() thread-safe?

2006-06-22 Thread Russell Warren
I'm guessing no, since it skips down through any Lock semantics, but I'm wondering what the best way to clear a Queue is then. Esentially I want to do a "get all" and ignore what pops out, but I don't want to loop through a .get until empty because that could potentially end up racing another thre

Re: better Python IDE? Mimics Maya's script editor?

2006-06-22 Thread Russell Warren
Check out the Wing IDE - www.wingware.com . As part of it's general greatness it has a "debug probe" which lets you execute code snippets on active data in mid-debug execution. It doesn't have precisely what you are after... you can't (yet) highlight code segments and say "run this, please", but

Re: Is Queue.Queue.queue.clear() thread-safe?

2006-06-27 Thread Russell Warren
Thanks guys. This has helped decipher a bit of the Queue mechanics for me. Regarding my initial clear method hopes... to be safe, I've re-organized some things to make this a little easier for me. I will still need to clear out junk from the Queue, but I've switched it so that least I can stop t

BoaConstructor

2006-09-29 Thread Matthew Warren
..I'm just about to start a project, I have a threaded python app currently around 3000 lines / 12-15 source files that is cli driven, and I am about to start using boaConstructor to build a GUI around it.   Has anyone here any advice on wether boaConstructor is actually a good tool for this

RE: Problems with Python 2.5 installer.

2006-09-29 Thread Matthew Warren
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of paw Sent: 29 September 2006 11:01 To: python-list@python.org Subject: Re: Problems with Python 2.5 installer. John Machin wrote: > paw wrote: > > I have ran the MSI installer for Python 2.5 several times at

RE: Making sure script only runs once instance at a time.

2006-09-29 Thread Matthew Warren
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hari SekhonSent: 29 September 2006 14:55To: python-list@python.orgSubject: Re: Making sure script only runs once instance at a time. I'm not sure if that is a very old way of doing it, which is why I wa

RE: Making sure script only runs once instance at a time.

2006-09-30 Thread Matthew Warren
Apologies for repost. not sure what happened.   This email is confidential and may be privileged. If you are not the intended recipient please notify the sender immediately and delete the email from your computer. You should not copy the email, use it for any purpose or disclose its contents

Raw strings and escaping

2006-10-03 Thread Matthew Warren
Hi, I would expect this to work, rawstring=r'some things\new things\some other things\' But it fails as the last backslash escapes the single quote. ..although writing this I think I have solved my own problem. Is \' the only thing escaped in a raw string so you can place ' in a raw string? Alt

RE: Escapeism

2006-10-03 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Kay Schluehr > Sent: 30 September 2006 18:02 > To: python-list@python.org > Subject: Re: Escapeism > > Sybren Stuvel wrote: > > Kay Schluehr enlightened us with: > > > Usually I struggle a

RE: Escapeism

2006-10-03 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Matthew Warren > Sent: 03 October 2006 16:07 > To: python-list@python.org > Subject: RE: Escapeism > > > > > -Original Message- > &

Improving telnetlib

2006-10-04 Thread Matthew Warren
Hi, I use telnetlib in an app I am writing, and would like to add functionality to it to support interactive terminal sessions , IE: be able to 'vi' a file. Currently it seems telnetlib isnt quite sophisticated enoguh to support such a thing. The trouble is, I havent got a clue where to start

RE: Raw strings and escaping

2006-10-04 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Scott David Daniels > Sent: 03 October 2006 18:11 > To: python-list@python.org > Subject: Re: Raw strings and escaping > > Matthew Warren wrote: > >

Finding the public callables of self

2006-02-09 Thread Russell Warren
Is there any better way to get a list of the public callables of self other than this? myCallables = [] classDir = dir(self) for s in classDir: attr = self.__getattribute__(s) if callable(attr) and (not s.startswith("_")): myCallables.append(s) #collect the names (n

Re: Finding the public callables of self

2006-02-09 Thread Russell Warren
> import inspect > myCallables = [name for name, value in inspect.getmembers(self) if not > name.startswith('_') and callable(value)] Thanks. I forgot about the inspect module. Interestingly, you've also answered my question more than I suspect you know! Check out the code for inspect.getmember

Profiling/performance monitoring in win32

2006-02-17 Thread Russell Warren
The application we're working on at my company currently has about eleventy billion independent python applications/process running and talking to each other on a win32 platform. When problems crop up and we have to drill down to figure out who is to blame and how, we currently are using the (surp

Re: Strings for a newbie

2005-05-28 Thread Warren Block
; >> For i = 1 to CountFields(s," ") >> a.append NthField(s," ",i) >> next >> >> That's it an array a() containing the words of the sentence. [snip] > Now a "slim" version: > > s = "This is a sentence of words" >

RE: c[:]()

2007-05-31 Thread Warren Stringer
> >> c[:] holds many behaviors that change dynamically. > > > > I've absolutely no clue what that sentence means. If c[:] does > > behave differently than c, then somebody's done something > > seriously weird and probably needs to be slapped around for > > felonious overriding. I'm still a bit ne

RE: Is PEP-8 a Code or More of a Guideline?

2007-05-31 Thread Warren Stringer
Wildemar Wildenburger wrote: > This may be a nice > idea for the Next Overwhelming Programming Escapade (Codename: NOPE) > ... > You may want to elaborate on the "new way to think about names". Maybe > you have a point which I just don't see. Is it considered pythonic to LOL? Nietzsche would lov

RE: c[:]()

2007-05-31 Thread Warren Stringer
Quotes out of context with mistaken assumptions, now follow: > So c[:]() -- or the more recent go(c)() -- executes all those > behaviors. > > No it doesn't. See below. > > > > If c[:]() works, the so does this, using real world names > > > > orchestra[:].pickle() > > orchestra[c

RE: c[:]()

2007-05-31 Thread Warren Stringer
> > What?!? I started this thread. > > > No you didn't. Your original post was a reply to a message whose subject > line was 'Re: "is" and ==', and included the header > > In-Reply-To: <[EMAIL PROTECTED]> You're right, thanks. > >> I think the fundamental mistake you have made is to convince you

RE: c[:]()

2007-05-31 Thread Warren Stringer
> > I did not hijack another thread > > You really did. In the first message you sent, we see the following > header: > > > In-Reply-To: <[EMAIL PROTECTED]> ... Damn! I suck. Outlook as a newsreader sucks. I need to use something else. > I retyped the code you posted in the first pos

RE: c[:]()

2007-05-31 Thread Warren Stringer
_call__ create any extra indirection? If yes, then I presume that `do(c)()` would be slower the `c[:]()`. I am writing rather amorphous code. This may speed it up. 4) I posit yes. Am I missing something? What idiom does would c[:]() break? This correlates with whether `c[:]()` breaks the language d

RE: c[:]()

2007-05-31 Thread Warren Stringer
issues, though you > will of course get all sorts of opinions on c.l.py. Oh well. Perhaps I can relax and actually write functioning code ;-) What do you mean by 'c.l.py' ? The first thing that comes to mind is 'clippy' that helpful little agent in Word that helped pay for Simonyi's trip into space. Ching ching, Warren -- http://mail.python.org/mailman/listinfo/python-list

RE: c[:]()

2007-06-01 Thread Warren Stringer
> Warren Stringer wrote: > > > `c[:]()` is unambiguous because: > > > > def c(): print 'yo' > > > > c() # works, but > > c[:]() # causes: > > > > Traceback (most recent call last)... > > c[:]()

RE: c[:]()

2007-06-01 Thread Warren Stringer
> Warren Stringer wrote: > > > As mentioned a while back, I'm now predisposed towards using `do(c)()` > > because square brackets are hard with cell phones. The one mitigating > factor > > for more general use, outside of cell phones, is speed. > > The spee

RE: c[:]()

2007-06-01 Thread Warren Stringer
> And that your > insisting on ``c[:]()`` instead of just ``c()`` seems to indicate you want > a change that is quite surprising. It would mean that a slice of a list > returns an other type with the __call__ method implemented. I am not insisting on anything. I use ``c[:]()`` as shorthand way of

RE: c[:]()

2007-06-01 Thread Warren Stringer
> > [Please quit saying "a container" if you mean lists and tuples. > > "A container" is way too general. There most probably _are_ > > containers for which c() does not fail.] > > One example of such a container is any folderish content in Zope: > subscripting gets you the contained pages, calli

RE: c[:]()

2007-06-01 Thread Warren Stringer
Thanks, Dakz for taking the time to reply: > This discussion has gone in more circles than Earth has gone 'round > the Sun, but it seems you should consider the following: Yes, I've been feeling a bit dizzy > 1) Sequences and functions serve fundamentally different purposes in > Python. One is f

RE: c[:]()

2007-06-01 Thread Warren Stringer
Gabriel wrote: > I begin to think you are some kind of Eliza experiment with Python > pseudo-knowledge injected. Tell me more about your feelings that I am an Eliza experiment with Python with pseudo knowledge injected. Thanks for the code example. -- http://mail.python.org/mailman/listinfo/pyt

RE: c[:]()

2007-06-02 Thread Warren Stringer
Andre Engels wrote: > > I am not insisting on anything. I use ``c[:]()`` as shorthand way of > saying > > "c() for c in d where d is a container" > > > > Having c() support containers seems obvious to me. It jibes with duck > > typing. Perhaps the title of this thread should have been: "Why don't >

RE: c[:]()

2007-06-02 Thread Warren Stringer
Oops, forgot to cut and paste the point, to this: > > - there is no Python error for "you > > cannot do this with this object, but you can do it with other objects > > of the same type". > > Yes there is: > > # > def yo(): print "yo" > def no(): print blah > yo() > no()

RE: c[:]()

2007-06-03 Thread Warren Stringer
> Anyway, the code below defines a simple "callable" list; it just calls > each contained item in turn. Don't bother to use [:], it won't work. > > py> class CallableList(list): > ... def __call__(self): > ... for item in self: > ... item() > ... > py> def a(): print "a" > ... > py> d

RE: c[:]()

2007-06-04 Thread Warren Stringer
> "Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > || Warren Stringer wanted to call the functions just for the side effects > | without interest in the return values. So building a list of return > | values which

RE: c[:]()

2007-06-05 Thread Warren Stringer
Roland Puntaier [mailto:[EMAIL PROTECTED] > Warren, can you please restate your point. Hey Roland, where were you a few days ago ;-) I think most suggestions were valid, in their own context. Only yesterday, was I finally able to get it in perspective, so here goes: There are two idioms

RE: c[:]()

2007-06-06 Thread Warren Stringer
': .' means ': ...' (its an outlook thing) -- http://mail.python.org/mailman/listinfo/python-list

Hooking exceptions outside of call stack

2007-06-09 Thread Warren Stringer
ack unhandled NameError exceptions, so that they unwind the stack normally? This is intended for production code. Many thanks! Warren -- http://mail.python.org/mailman/listinfo/python-list

RE: Hooking exceptions outside of call stack

2007-06-09 Thread Warren Stringer
Am still trying to hook a NameError exception and continue to run. After a few more hours of searching the web and pouring over Martelli's book, the closest I've come is: >>> import sys >>> def new_exit(arg=0): ... print 'new_exit called' ... #old_exit(arg) ... >>> def hook(type, value, tb

RE: Hooking exceptions outside of call stack

2007-06-09 Thread Warren Stringer
> Yes. Python doesn't have restartable exceptions. Perhaps you would like > to take a look at CL or Smalltalk? > > Jean-Paul Hmmm, I wonder if anyone suggest to Philippe Petit, as stepped out 110 stories off the ground, that perhaps he would like to take a look at a different tightrope? Oddly

RE: Ableton Live Python API is out!

2007-06-09 Thread Warren Stringer
Alia Khouri Write > I have been waiting for this ages and it's finally happened! Python > meet Live, Live meet Python! Wow. This is very cool; thanks for the announcement! > I rushed to update http://wiki.python.org/moin/PythonInMusic but lo Thanks for this link, as well. Very useful. --

RE: Hooking exceptions outside of call stack

2007-06-09 Thread Warren Stringer
Josiah Carlson wrote: > >>> foo = type(foo)(foo.func_code, d, foo.func_name, foo.func_defaults, > foo.func_closure) Wow! I've never seen that, before. Is there documentation for `type(n)(...)` somewhere? I did find a very useful "Decorator for Binding Constants, by Raymond Hettinger", that uses t

  1   2   >