inspect.getblock()

2007-04-22 Thread Aaron Brady
inspect.getblock() seems to halt prematurely. This code only prints 6 lines of the 12 line input file. assume it's by design, but the docs don't mention getblock. docstring is "Extract the block of code at the top of the given list of lines," which should be "code *from* the top." ###whati

function object.func_default off the console

2007-04-24 Thread Aaron Brady
>>> f.func_defaults[0] [2, 3] >>> f.func_defaults[0]+=[4] Traceback (most recent call last): File "", line 1, in TypeError: 'tuple' object does not support item assignment >>> f.func_defaults[0] [2, 3, 4] V. interesting. Operation succeeds but with a throw. Er, raise. -- http://mail.python.

Re: renaming an open file in nt like unix?

2007-07-25 Thread aaron . watters
that. We implemented something like this to replace > > dlls there are currently in use... > > You do have to be careful though, because sometimes Windows refuses to > let you rename a file because it's in use. At least on my laptop I see Steve's behaviour. fwiw: C:\D

shelf membership

2007-03-31 Thread Aaron Brady
can you shelve objects with membership? this gives you: TypeError: object does not support item assignment dict 0 True Exception exceptions.TypeError: 'object does not support item assignment' in ignored > ignored is a bit mysterious. tx in advance. from shelve import * class MyShelf(Dbfilen

ANN: NUCULAR fielded text searchable indexing

2007-10-08 Thread aaron . watters
ing issues. -- Nucular indexes and retrieves large collections quickly. Read more and download at: http://nucular.sourceforge.net Online demos: http://www.xfeedme.com/nucular/gut.py/go http://www.xfeedme.com/nucular/mondial.py/go I hope you like! -- Aaron Watters === I don't know ka-RAH-te

Re: NUCULAR fielded text searchable indexing

2007-10-09 Thread aaron . watters
ot; has already turned me off wanting to find out more about it. > > Tim Delaney No, it doesn't stand for anything. I guess it's not for you :(. Sorry about that. (see the graphic at the bottom of http://nucular.sourceforge.net) -- Aaron Watters === An apple every 8 hours wil

Re: NUCULAR fielded text searchable indexing

2007-10-09 Thread aaron . watters
in my open source projects? Besides there is a great tradition of tounge-in-cheek package names, like "Cold fusion", for example. Actually one reason I chose it, is I own nucularOption.com and also http://nucular.sourceforge.net was available. too late now. sorry again, -- Aaron Wat

Re: NUCULAR fielded text searchable indexing

2007-10-09 Thread aaron . watters
roblem it's probably only the first of many reasons they won't want to use it or will not like it because it doesn't match their preconceptions. But if there's some way to change the name easily in the next week or so, I'll consider it anyway. hints? -- Aaron Watters ===

Re: NUCULAR fielded text searchable indexing

2007-10-10 Thread aaron . watters
most purposes into nucular. Others may appear in later releases, but the one's that are there cover the most common needs, I think. I would prefer benchmarks that compared simple common examples, not obscure complicated ones. -- Aaron Watters === if you want a friend, get a dog. -- Trum

Re: Fwd: NUCULAR fielded text searchable indexing

2007-10-11 Thread aaron . watters
an be very nice to have one access handled by one process in one thread leaving the other cpu's available to handle other accesses or do other things. imho, fwiw, ymmv, rsn, afaik. -- Aaron Watters === even in a perfect world where everyone is equal i'd still own the film rights and b

Re: Fwd: NUCULAR fielded text searchable indexing

2007-10-11 Thread aaron . watters
ed in really addressing the "google" size of data set at the moment. > http://www.newegg.com/Product/Product.aspx?Item=N82E16820147021 holy rusty metal batman! way-cool! thanks, -- Aaron Watters === less is more -- http://mail.python.org/mailman/listinfo/python-list

Re: Fwd: NUCULAR fielded text searchable indexing

2007-10-15 Thread aaron . watters
> Heh, check out the benchmark graphs: > > http://www.tomshardware.com/2006/09/20/conventional_hard_drive_obsole... My point exactly :)... Thanks again -- Aaron Watters give me chocolate and no one gets hurt. (from a tee shirt) -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: NUCULAR 0.1 Fielded Full Text Indexing [BETA]

2007-10-24 Thread aaron . watters
cess or other system support such as shared memory locking. -- Nucular supports concurrency. Arbitrary concurrent updates and accesses by multiple processes or threads are supported, with no possible locking issues. -- Nucular indexes and retrieves large collections quickly. I hope you like.

Re: "Standard" Full Text Search Engine

2007-10-26 Thread aaron . watters
t;cp"?) -- I suspect some sort of trickery, frankly. Anyway, if you want a feature like proximity searching or some sort of internationalization support (it works with unicode, but that's probably not enough), please let me know. I focused on the core indexing and retrieval function

Re: NUCULAR fielded text searchable indexing

2007-10-26 Thread aaron . watters
for a package released back in '94, eh? -- Aaron Watters === The method employed I would gladly explain, While I have it so clear in my head, If I had but the time and you had but the brain-- But much yet remains to be said. -- http://www.xfeedme.com/nucular/gut.py/go?FREETEXT=sn

Re: marshal vs pickle

2007-10-31 Thread Aaron Watters
dfly.sourceforge.net and nucular full text/fielded search http://nucular.sourceforge.net use marshal as the underlying serializer. Using cPickle would probably make serialization worse than 2x slower. This is one of the 2 or 3 key tricks which make these packages as fast as they are. -- A

Re: marshal vs pickle

2007-10-31 Thread Aaron Watters
On Oct 31, 1:37 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > On Oct 31, 6:45 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > I like to use > > marshal a lot because it's the absolutely fastest > > way to store and load data to/from Python

Re: marshal vs pickle

2007-11-01 Thread Aaron Watters
Therefore pickle should not be used as a general RPC > mechanism. This is absolutely correct. Marshal is more secure than pickle because marshal *cannot* execute code automatically whereas pickle does. The assertion that marshal is less secure than pickle is absurd. This is exactly why the gadf

Re: marshal vs pickle

2007-11-01 Thread Aaron Watters
On Oct 31, 6:10 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > On Oct 31, 12:27 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > > Makes more sense to use cPickle and be done with it. > > FWIW, I've updated the docs to be absolutely clear on the subject:

Re: marshal vs pickle

2007-11-01 Thread Aaron Watters
On Nov 1, 2:15 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > On Nov 1, 4:45 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > Marshal is more secure than pickle > > "More" or "less" make little sense in a security context which > typi

Re: marshal vs pickle

2007-11-01 Thread Aaron Watters
On Nov 1, 4:59 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Thu, 01 Nov 2007 20:35:15 -0000, Aaron Watters <[EMAIL PROTECTED]> wrote: > >On Nov 1, 2:15 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > >> On Nov 1, 4:45 am, Aaron Watters <[EMAIL

Re: marshal vs pickle

2007-11-02 Thread Aaron Watters
On Nov 1, 11:42 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > Aaron Watters <[EMAIL PROTECTED]> writes: > > > >>> marshal.loads('RKp,U\xf7`\xef\xe77\xc1\xea\xd8\xec\xbe\\') > > > Segmentation fault > > >... > > I'll

Re: marshal vs pickle

2007-11-02 Thread Aaron Watters
On Nov 1, 10:12 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > On Oct 31, 6:10 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > Alright already. Here is the patched file you want > > http://nucular.sourceforge.net/kisstree_pickle.py This file has been removed. A

Re: Python good for data mining?

2007-11-05 Thread Aaron Watters
ol If you find that you need some functionality that is missing, it may be easy to add. Let me know. For example the underlying indexing methodology can be manipulated in many clever ways to get different performance characteristics. -- Aaron Watters === When at first you don't succeed give up

Re: Python good for data mining?

2007-11-05 Thread Aaron Watters
ter than most other rdbms's for apps like data mining where you don't need transactional support, especially if you use the table implementations that don't support ACID transactions. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=segmentation%20fault

Re: Python good for data mining?

2007-11-06 Thread Aaron Watters
eory (or category theory or similar) which is fundamentally relational. Historically hierarchical/network databases preceded rdbms's because they are fundamentally more efficient. Unfortunately, they are also fundamentally more inflexible (it is generally agreed). -- Aaron Watters === http:/

Re: Information manager/organizer with tags question.

2007-11-12 Thread Aaron Watters
t (especially for free). However, I have to plug nucular as a possible back end data store that may make it easier for you to implement the app you outlined. Please have a look: http://nucular.sourceforge.net See the "demos" for examples of what you can do with it very easil

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-14 Thread Aaron Watters
ch are longs, as done in http://nucular.sourceforge.net and http://bplusdotnet.sourceforge.net and elsewhere. Someone please summarize. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=white%20trash -- http://mail.python.org/mailman/listinfo/python-list

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Aaron Watters
thing. The bulk of the newbies are either off in VB land or struggling with java. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=silly+walk -- http://mail.python.org/mailman/listinfo/python-list

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Aaron Watters
dicts that consume beyond that.That's better than I feared at any rate... -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=especially+nasty+windows -- http://mail.python.org/mailman/listinfo/python-list

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Aaron Watters
ace), so you run into memory contention issues sooner than on 32 bit machines, for similar memory sizes. If there is something deeper going on please correct me, I would very much like to know. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=alien+fri

gc penalty of 30-40% when manipulating large data structures?

2007-11-16 Thread Aaron Watters
our run, finding nothing every time. Just my 2c. -- Aaron Watters nucular full text fielded indexing: http://nucular.sourceforge.net === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=dingus%20fish -- http://mail.python.org/mailman/listinfo/python-list

Re: Log Search code is not working

2007-11-18 Thread Aaron Watters
and the dictionary.has_key(...) method instead of looping over lists. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=long+necked On Nov 18, 7:12 pm, "martin" <[EMAIL PROTECTED]> wrote: > Hello, > > I need some help with my job assignment

Re: Python too complex ?!?!?!

2007-11-19 Thread Aaron Watters
as some serious advantages. I don't see anything wrong in teaching a bit of both, tho. Students also like to learn languages which they can find in the "help wanted" section very easily ;). -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=perverse+zone -- http://mail.python.org/mailman/listinfo/python-list

Re: Python too complex ?!?!?!

2007-11-20 Thread Aaron Watters
strings in week 3+ and hash tables and other scary things would probably wait for the second course. IronPython anyone? (btw, what's up with IronPython?) -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=crash+many+ways&FocusId=1593 -- http://mail.python.org/mailman/listinfo/python-list

Re: 100% CPU Usage when a tcp client is disconnected

2007-11-22 Thread Aaron Watters
Try chaning it to data = "dummy" while data: ... -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=help+infinite+loop -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python

2007-11-26 Thread Aaron Watters
nything. > > Any help would be appreciated. I'm guessing the file is okay, but something involving naming is wrong. Check the error log file(s). It may show that mod_py is looking inside the module and not finding the right function/method. As others have said, some sample code wou

Re: How to Teach Python "Variables"

2007-11-27 Thread Aaron Watters
mple examples at the interactive prompt. But if you talk like the above to them, they will run for the hills... (no offense intended). -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=evil+fish -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Teach Python "Variables"

2007-11-27 Thread Aaron Watters
-- adding, deleting, changing freely -- and I think this was motivated by the "C" level understanding that it really is just another hash table. From a pythonic perspective you would never think of behaving this way except under extreme duress. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=revolting+delicate -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Teach Python "Variables"

2007-11-27 Thread Aaron Watters
ation frameworks, even in Python -- too much strange magic floats around in the air -- usually in order to make things "easy" that I never thought were hard in the first place. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=lame+hack+wink -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Teach Python "Variables"

2007-11-28 Thread Aaron Watters
rst few weeks trying to talk about the filesystem. Instead you say "follow these steps and all will become clear later." It's not a matter of preference -- it's a matter of necessity. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=lazy+future+generation -- http://mail.python.org/mailman/listinfo/python-list

Re: Python web frameworks

2007-11-29 Thread Aaron Watters
nterpreter a lot slower (which may be why javascript is pretty slow). -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=msie+de-facto+recognized+dim -- http://mail.python.org/mailman/listinfo/python-list

Re: "Python" is not a good name, should rename to "Athon"

2007-11-30 Thread Aaron Watters
ltural backgrounds. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=nasty+reasons -- http://mail.python.org/mailman/listinfo/python-list

Best way to merge/sort two sorted lists?...

2007-12-06 Thread Aaron Watters
ice tiny extension module (at least for my purposes). See timing demonstration code below. Let me know if there is a better way or if the test is fatally flawed, please. --- Aaron Watters http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=greedy+bastard ==snip: test code belo

Re: Best way to merge/sort two sorted lists?...

2007-12-06 Thread Aaron Watters
l's merge_sorted is a bit slower than any of mine due to the use of list.append, I think instead of preallocating a list of the right size. -- Aaron === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=inherently+hosed -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to merge/sort two sorted lists?...

2007-12-07 Thread Aaron Watters
On Dec 6, 9:51 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Aaron Watters" <[EMAIL PROTECTED]> wrote in message > The current version of list.sort (timsort) was designed to take advantage > of pre-existing order. It should discover the 2 sorted sublist

Re: Best way to merge/sort two sorted lists?...

2007-12-10 Thread Aaron Watters
On Dec 6, 2:01 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > On Dec 6, 9:30 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > See recipes: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491285 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/305269 I previ

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Aaron Denney
are usually perceived to beneficial (exception: > people from a Java/C/C++ background often perceive dynamic > typing as a misfeature and have to struggle with it) It is a misfeature. It's just less of a misfeature than the typing of Java/C/C++, etc. -- Aaron Denney -&g

Re: Reg Ex help

2006-05-11 Thread Aaron Barclay
/main/parallel_branch_1/release_branch_1.0/dbg_for_python/CHECKEDOUT from /main/parallel_branch_1/release_branch_1.0/4' p = re.compile('/\S*/\S*/\S*/(\S*)/') m = re.search(p, path) . if m: print m.group(1) This is a good reference... http://www.amk.ca/python/howto/regex/ Hope that help

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Aaron Gray
I was once a religous tabber until working on multiple source code sources, now I am a religious spacer :) My 2bits worth, Aaron -- http://mail.python.org/mailman/listinfo/python-list

cloud computing (and python)?

2008-01-01 Thread Aaron Watters
it could be used. Bonus points if you mention Python in the response! An actual example would be great, if it's not web scraping and searching. - Aaron Watters == http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=snow -- http://mail.python.org/mailman/listinfo/python-list

Re: cloud computing (and python)?

2008-01-01 Thread Aaron Watters
m having trouble understanding why people would want to buy in to this. For example at the amazon site I see things like "it might take a couple minutes to load your image..." Are they joking? hmmm. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=try+not+to+a

Re: cloud computing (and python)?

2008-01-02 Thread Aaron Watters
ome hints above, but it's mixed in with a lot of other stuff...) -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=fud -- http://mail.python.org/mailman/listinfo/python-list

ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-13 Thread Aaron Watters
d, with no possible locking issues. Nucular supports document threading in the manner of USENET replies. Built in semantics allows "follow ups" to messages to match patterns that match the "original" messages. Nucular indexes and retrieves data quickly. I hope you like. -- Aaron

Re: ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-14 Thread Aaron Watters
On Feb 14, 3:50 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > The main thing killing most of the search apps that I'm involved with > is disk latency. If Aaron is listening, I might suggest offering a > config option to redundantly recording the stored search fields with

Re: ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-22 Thread Aaron Watters
better/standard name, yes? What is it please? Thanks! Answers from anyone else welcomed also. [Nucular: http://nucular.sourceforge.net/ ] -- Aaron Watters === There are 3 kinds of people: those who can count, and those who can't. http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=shit

Re: ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-25 Thread Aaron Watters
On Feb 22, 5:31 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > Aaron Watters <[EMAIL PROTECTED]> writes: > > 3) ...I was thinking > > of adding an optional feature to Nucular which would allow > > a look-up like "given a word find all attributes that con

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Aaron Watters
the programming stuff on the job, since most of what counts seems to be politics, really. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=spam+eggs -- http://mail.python.org/mailman/listinfo/python-list

Andy Pausch (of Alice fame) -- last lecture

2008-02-26 Thread Aaron Watters
h/ You've probably already seen it, but I thought I'd point out the Python angle. It's a good view to help put things in perspective. Its one of those internet phenomena. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=life+instance -- http://mail.py

Re: Andy Pausch (of Alice fame) -- last lecture

2008-02-26 Thread Aaron Watters
On Feb 26, 10:03 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > Hi folks. Andy Pausch who headed up the Alice project > which aims to teach 3D animation using Python ... Oops. It looks like Alice 1.0 was Python; 2.0 is java, but whatever. -- Aaron Watters === http://www.xfeedme

Re: why not bisect options?

2008-03-04 Thread Aaron Watters
e fine to add something like this as an additional elaboration, but I want bisect to scream as fast as possible in the default streamlined usage. -- Aaron Watters === dueling bumper stickers: use java/get rich use perl/get laid -- both equally sensible http://www.xfeedme.com/nucular/pydist

off topic: 2 videos on source control and open source development

2008-03-08 Thread Aaron Watters
This one is about managing the community dynamics in the subversion project. http://video.google.nl/videoplay?docid=-4216011961522818645 It only made me a little uncomfortable at certain moments :). Good viewing. -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT

Re: Pycon disappointment

2008-03-19 Thread Aaron Watters
guis... without conveying any useful information (to me) in 30 minutes. If you tell them they have 10 minutes and make them get organized in advanced they are much more likely to get to the point and everyone can see something else before they run out of attention span. -- Aaron Watters === by

Re: csv Parser Question - Handling of Double Quotes

2008-03-27 Thread Aaron Watters
s, delimiter): for line in lines: fields = line.split(delimiter) fields = map(trimQuotes, fields) yield fields def test(): lines = ['"t"h"is";"is";"a";"test"'] for fields in simpleCsv(lines, ';'):

Re: csv Parser Question - Handling of Double Quotes

2008-03-28 Thread Aaron Watters
zarre and surprising results in the illustrated case. It's a matter of taste of course... -- Aaron Watters === http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=mondo+bizarre -- http://mail.python.org/mailman/listinfo/python-list

Re: why cannot assign to function call

2009-01-10 Thread Aaron Brady
On Jan 9, 9:30 am, Joe Strout wrote: > Aaron Brady wrote: > > Possible compromise.  You can think of functions as mutation-only. > > You pass the object, and it gets a new (additional) name.  The old > > name doesn't go in.   > > That's correct.  The r

Re: why cannot assign to function call

2009-01-11 Thread Aaron Brady
On Jan 10, 1:49 pm, Joe Strout wrote: > Aaron Brady wrote: > >> Aaron Brady wrote: > >>> Possible compromise.  You can think of functions as mutation-only. > >>> You pass the object, and it gets a new (additional) name.  The old > >>> name does

Re: if-else statement

2009-01-11 Thread Aaron Brady
On Jan 10, 2:28 pm, bearophileh...@lycos.com wrote: > Scott David Daniels: > > >       if checking: > >           my_var = 'string' > >       else: > >           my_var = 'other string' > > > remember, vertical space only kills trees if printed. > > I value clarity a lot. But this is more DRY, some

Re: why cannot assign to function call

2009-01-11 Thread Aaron Brady
On Jan 11, 8:32 am, Paul Rubin wrote: > Steven D'Aprano writes: > > If it walks like pass-by-reference, and smells like pass-by-reference, > > and swims like pass-by-reference, is it still your contention that it is > > pass-by-value? > > Of course the C example is p

Re: Standard IPC for Python?

2009-01-13 Thread Aaron Brady
On Jan 13, 2:04 pm, Laszlo Nagy wrote: > - create a wrapper, using ctypes, /windll / cdll/ to access API functions > - use CreateFileMapping on the page file to create shared memory (a la > windows:http://msdn.microsoft.com/en-us/library/aa366537.aspx) > - use CreateEvent/WaitForSingleObject for s

Re: ctype problem

2009-01-13 Thread Aaron Brady
On Jan 13, 10:22 am, Grimson wrote: > hello out there, > I have a problem with c-types. > I made a c-library, which expects a pointer to a self defined structure. > > let the funtion call myfunction(struct interface* iface) > > and the struct: > struct interface > { >     int a; >     int b; >    

Re: why cannot assign to function call

2009-01-13 Thread Aaron Brady
On Jan 13, 5:06 pm, Mark Wooding wrote: snip > I'm going to move away from the formal semantics stuff and try a > different tack.  Here's what I think is the defining property of > pass-by-value (distilled from the formal approach I described earlier, > but shorn of the symbolism): > >   The calle

Re: executing multiple functions in background simultaneously

2009-01-14 Thread Aaron Brady
On Jan 13, 7:02 pm, Catherine Moroney wrote: > Hello everybody, > > I know how to spawn a sub-process and then wait until it > completes.  I'm wondering if I can do the same thing with > a Python function. > > I would like to spawn off multiple instances of a function > and run them simultaneously

Re: why cannot assign to function call

2009-01-14 Thread Aaron Brady
On Jan 14, 3:51 am, Mark Wooding wrote: > Aaron Brady wrote: > > On Jan 13, 5:06 pm, Mark Wooding wrote: > > snip > > > I'm going to move away from the formal semantics stuff and try a > > > different tack.  Here's what I think is the defining property

reverse dict lookup & Relation class

2009-01-14 Thread Aaron Brady
Hi, this is a continuation of something that comes up now and again about reverse lookups on dictionaries, as well as a follow-up to my pursuit of a Relation class from earlier. For a reverse lookup, you just need two lookups. name= {} phone= {} name[ '555-963' ]= 'Joan' phone[ 'Joan' ]= '555-963'

Re: executing multiple functions in background simultaneously

2009-01-14 Thread Aaron Brady
On Jan 14, 6:00 pm, Cameron Simpson wrote: > On 14Jan2009 15:50, Catherine Moroney > wrote: > > > James Mills wrote: > >> On Wed, Jan 14, 2009 at 11:02 AM, Catherine Moroney > >> wrote: > >>> I would like to spawn off multiple instances of a function > >>> and run them simultaneously and then w

Re: Why this code is working?

2009-01-15 Thread Aaron Brady
On Jan 14, 7:21 am, "Diez B. Roggisch" wrote: > r wrote: > > Listen Hussien, > > Granted, with a name of "r", spelling it wrong is hard, and thus you might > not be trained in the art of spelling names proper. Or spelling proper names! Bah ha. -- http://mail.python.org/mailman/listinfo/python-li

Re: Convention vs. fascism

2009-01-15 Thread Aaron Brady
On Jan 15, 6:41 pm, Steven D'Aprano wrote: > On Fri, 16 Jan 2009 10:24:19 +1100, Ben Finney wrote: > > Steven D'Aprano writes: > > >> On Fri, 16 Jan 2009 07:58:49 +1100, Ben Finney wrote: > > >> > Steven D'Aprano writes: > > >> >> On Thu, 15 Jan 2009 10:08:37 +0100, Diez B. Roggisch wrote: > > >

Re: reverse dict lookup & Relation class

2009-01-16 Thread Aaron Brady
On Jan 14, 7:04 pm, Chris Rebert wrote: > On Wed, Jan 14, 2009 at 4:30 PM, Aaron Brady wrote: > > Hi, this is a continuation of something that comes up now and again > > about reverse lookups on dictionaries, as well as a follow-up to my > > pursuit of a Relation class from

Re: reverse dict lookup & Relation class

2009-01-16 Thread Aaron Brady
On Jan 14, 7:54 pm, MRAB wrote: > Aaron Brady wrote: > > Hi, this is a continuation of something that comes up now and again > > about reverse lookups on dictionaries, as well as a follow-up to my > > pursuit of a Relation class from earlier. > > > For a reverse loo

Re: reverse dict lookup & Relation class

2009-01-17 Thread Aaron Brady
On Jan 16, 5:03 am, Steven D'Aprano wrote: > On Wed, 14 Jan 2009 16:30:36 -0800, Aaron Brady wrote: > > Hi, this is a continuation of something that comes up now and again > > about reverse lookups on dictionaries, as well as a follow-up to my > > pursuit of a R

Re: multiprocessing question/error

2009-01-17 Thread Aaron Brady
On Jan 16, 11:39 pm, Eduardo Lenz wrote: > Hi, > > I was using the former processing package with python 2.5 with no problems. > After switching to python 2.6.1 I am having some problems with the same code. > The problem seems to be related to the fact that I am using Pool.map > with a bounded met

Re: English-like Python

2009-01-17 Thread Aaron Brady
On Jan 15, 7:02 pm, The Music Guy wrote: > Just out of curiousity, have there been any attempts to make a version > of Python that looks like actual English text? I mean, so much of Python > is already based on the English language that it seems like the next > natural step would be to make a prog

Re: reverse dict lookup & Relation class

2009-01-17 Thread Aaron Brady
On Jan 17, 10:45 am, Steven D'Aprano wrote: > On Sat, 17 Jan 2009 00:24:21 -0800, Aaron Brady wrote: > > Can you make it work for a 3-way lookup? > > What do you mean "3-way lookup"? > > I'm going to take a guess... > > A maps to B, B maps to C,

Re: Relax Syntax for Augmented Arithmetic?

2009-01-18 Thread Aaron Brady
On Jan 18, 6:56 am, andrew cooke wrote: > On Jan 18, 9:40 am, Marc 'BlackJack' Rintsch wrote: > > > On Sun, 18 Jan 2009 04:24:04 -0800, andrew cooke wrote: > > > my argument was that *= is not treated as = and *, but as a completely > > > new operator (the docs even say that the implementation ne

Re: function argument dependent on another function argument?

2009-01-18 Thread Aaron Brady
On Jan 18, 8:19 am, Reckoner wrote: > I  would like to do: > > def foo(self,x,y=self.a) > > where the default value for y=self.a. Since this is not possible, I > wind up doing > > def foo(self,x,y=None) >   if not y: >     y=self.a > > but that seems kind of clumsy. > > Is there a better way to do

Re: function argument dependent on another function argument?

2009-01-18 Thread Aaron Brady
On Jan 18, 9:36 am, Paul Rubin wrote: > Steven D'Aprano writes: > > def foo(self, x, y=None): > >     if y is None: > >         y = self.a > > > I don't find that clumsy in the least. I find it perfectly readable and a > > standard idiom. > > That has the same proble

Re: Ordering attributes for dynamically generated class

2009-01-18 Thread Aaron Brady
On Jan 18, 9:52 am, David Pratt wrote: > Hi list. I use 'type' to generate classes but have a need to order   > the attributes for the generated class. Of course a dict is not going   > to maintain ordering. Is there any way to dynamically generate a   > class with attributes in specific order? >

Re: function argument dependent on another function argument?

2009-01-18 Thread Aaron Brady
On Jan 18, 10:44 am, Rob Williscroft wrote: > Aaron Brady wrote > innews:6a10378f-addb-4d56-bc1b-0c382b3cb...@t26g2000prh.googlegroups.com > in comp.lang.python: > > > > > On Jan 18, 9:36 am, Paul Rubin <http://phr...@nospam.invalid> wrote: > >> Steven D&#x

Re: function argument dependent on another function argument?

2009-01-18 Thread Aaron Brady
On Jan 18, 12:42 pm, andrew cooke wrote: > >     sentinel = object() > >     ... > > >     def foo(x, y=sentinel): > >       if y is sentinel: > >           y = self.a > > it just struck me you could also do: > >      def foo(self, x, *y_args) >        y = y_args[0] if y_args self.a > > which more

Re: function argument dependent on another function argument?

2009-01-18 Thread Aaron Brady
On Jan 18, 12:02 pm, Rob Williscroft wrote: > Aaron Brady wrote > innews:582ef883-0176-4984-9521-6c1894636...@a26g2000prf.googlegroups.com > in comp.lang.python: > > > > > On Jan 18, 10:44 am, Rob Williscroft wrote: > >> Aaron Brady wrote > >>

Re: problem in implementing multiprocessing

2009-01-19 Thread Aaron Brady
On Jan 19, 3:09 am, Carl Banks wrote: snip > Since multiprocessing serializes and deserializes the data while > passing > it from process to process, passing very large objects would have a > very > high latency and overhead.  IOW, gopal's diagnosis is correct.  It's > just not practical to share

Re: English-like Python

2009-01-20 Thread Aaron Brady
On Jan 17, 6:10 pm, The Music Guy wrote: > Wow, impressive responses. > > It sounds like the general consensus is that English would not be a good > choice for programming even if there were an interpreter capable of > turning human language into machine language. But that makes sense; even > Engl

Re: English-like Python

2009-01-20 Thread Aaron Brady
On Jan 20, 12:58 pm, Joe Strout wrote: > Aaron Brady wrote: > > I think it would be a good step if you could make some sensible > > interpretation of a typical statement without its parentheses. > > > f "abc" 123 > > --> > > f( "abc&q

Re: English-like Python

2009-01-21 Thread Aaron Brady
On Jan 20, 9:16 pm, MRAB wrote: > Terry Reedy wrote: > > Joe Strout wrote: > >> Aaron Brady wrote: > > >>> I think it would be a good step if you could make some sensible > >>> interpretation of a typical statement without its parentheses. >

Re: English-like Python

2009-01-21 Thread Aaron Brady
On Jan 21, 2:36 am, Steven D'Aprano wrote: > On Tue, 20 Jan 2009 11:58:46 -0700, Joe Strout wrote: > > Aaron Brady wrote: > > >> I think it would be a good step if you could make some sensible > >> interpretation of a typical statement without its parentheses.

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-21 Thread Aaron Brady
On Jan 17, 11:28 pm, Steven D'Aprano wrote: > On Sat, 17 Jan 2009 20:49:38 +0100, Bruno Desthuilliers wrote: > > Russ P. a écrit : > >> On Jan 15, 12:21 pm, Bruno Desthuilliers > >> wrote: > > >>> Once again, the important point is that there's a *clear* distinction > >>> between interface and im

Re: English-like Python

2009-01-21 Thread Aaron Brady
On Jan 21, 9:24 am, Joe Strout wrote: > Aaron Brady wrote: > > Where functions are first-class objects, a bare function object isn't > > distinguishable either from its call. > > That depends not on whether functions are first-class objects, but on > the *synt

Re: English-like Python

2009-01-21 Thread Aaron Brady
On Jan 21, 2:50 pm, Scott David Daniels wrote: > Benjamin J. Racine wrote: > > I think it would be a good step if you could make some sensible > > interpretation of a typical statement without its parentheses. > > > f "abc" 123 > > --> > > f( "abc", 123 ) > > > It would be just the thing in a cou

Re: English-like Python

2009-01-22 Thread Aaron Brady
On Jan 22, 1:46 am, Steven D'Aprano wrote: > On Wed, 21 Jan 2009 00:57:49 -0800, Aaron Brady wrote: > > Natural language doesn't have the equivalent of parentheses, > > I take it you mean natural language doesn't have the equivalent of > parentheses for *cal

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