Re: Exotic Logics

2009-06-17 Thread Aaron Brady
On Jun 17, 10:04 am, Aaron Brady wrote: snip > You (OP) may be interested in the definitions of the fuzzy operators: > > and( x, y ) := min( x, y ) > or( x, y ) := max( x, y ) > not( x ) := 1 (one)- x > nand( x, y ) := not( and( x, y ) ) = 1- min( x, y ) > > Defining

Re: Exotic Logics

2009-06-17 Thread Aaron Brady
On Jun 17, 10:05 am, pdpi wrote: > On Jun 17, 5:37 pm, Lie Ryan wrote: > > > > > Steven D'Aprano wrote: > > > On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > > > >> I was staring at a logic table the other day, and I asked myself, "what > > >> if one wanted to play with exotic logic

Re: Exotic Logics

2009-06-17 Thread Aaron Brady
On Jun 17, 10:23 am, Mensanator wrote: > On Jun 17, 11:59 am, Aaron Brady wrote: > > > > > On Jun 17, 1:44 am, Steven D'Aprano > > > wrote: > > > On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > > > > I was staring at a

Re: Regarding Python is scripting language or not

2009-06-17 Thread Aaron Brady
On Jun 17, 7:38 am, Jean-Michel Pichavant wrote: > abhishek goswami wrote: > > Hi, > > I have very basic question about Python that do we consider pyhton as > > script language. > > I searched in google but it becomes more confusion for me. After some > > analysis I came to know that Python suppor

Re: Regarding Python is scripting language or not

2009-06-18 Thread Aaron Brady
On Jun 18, 6:07 am, Jochen Schulz wrote: > Terry Reedy: > > > Jochen Schulz wrote: > > >> If, by "object-oriented" you mean "everything has to be put into > >> classes", then Python is not object-oriented. > > > That depends on what you mean by 'put into classes' (and 'everything'). > > :) What I

Re: persistent composites

2009-06-19 Thread Aaron Brady
On Jun 17, 3:53 pm, "Rhodri James" wrote: > On Wed, 17 Jun 2009 16:06:22 +0100, Aaron Brady   > wrote: > > > > > On Jun 16, 10:09 am, Mike Kazantsev wrote: > >> On Tue, 16 Jun 2009 06:57:13 -0700 (PDT) > > >> Aaron Brady wrote: > >

Re: fastest native python database?

2009-06-19 Thread Aaron Brady
On Jun 17, 8:28 pm, per wrote: > hi all, > > i'm looking for a native python package to run a very simple data > base. i was originally using cpickle with dictionaries for my problem, > but i was making dictionaries out of very large text files (around > 1000MB in size) and pickling was simply too

Re: Rich comparison methods don't work in sets?

2009-06-19 Thread Aaron Brady
On Jun 19, 12:42 pm, Chris Rebert wrote: > On Fri, Jun 19, 2009 at 12:02 PM, Gustavo Narea wrote: > > Hello, everyone. > > > I've noticed that if I have a class with so-called "rich comparison" > > methods > > (__eq__, __ne__, etc.), when its instances are included in a set, > > set.__contains__/_

Re: Exotic Logics

2009-06-19 Thread Aaron Brady
On Jun 17, 10:32 am, Aaron Brady wrote: > On Jun 17, 10:23 am, Mensanator wrote: snip > > > I think high and low /voltages/, though continuous and approximate, > > > might satisfy this. > > > > There are no such things as electrons, > > > I'

Re: persistent composites

2009-06-19 Thread Aaron Brady
On Jun 19, 7:45 am, a...@pythoncraft.com (Aahz) wrote: > In article > , > Aaron Brady   wrote: > > > > >You are not being any help, Rhodri, in your question.   > > Maybe not, but honestly, you're getting pretty close to going back in my > killfile.  Althoug

Re: persistent composites

2009-06-20 Thread Aaron Brady
On Jun 19, 7:00 am, "Rhodri James" wrote: > On Fri, 19 Jun 2009 14:24:34 +0100, Aaron Brady   > wrote: > > > You are not being any help, Rhodri, in your question. > > To you, perhaps not.  To me, it has at least had the effect of making > what you'r

Re: Rich comparison methods don't work in sets?

2009-06-20 Thread Aaron Brady
On Jun 20, 9:27 am, MRAB wrote: > Gustavo Narea wrote: > > Hello again, everybody. > > > Thank you very much for your responses. You guessed right, I didn't > > use the __hash__ method (and I forgot to mention that, sorry). > > > And unfortunately, I think I can't make them hashable, because the >

Re: The Python Way for module configuration?

2009-06-27 Thread Aaron Sherman
On Jun 27, 4:38 pm, MRAB wrote: > > I would appreciate your comments and suggestions. > > There are already modules which provide access to databases. As you can see the "Python Way" is to be rude ;-) Anyway, your answer is that there are some abstraction layers called "ORMs". You can grab one

Using Python for file packing

2009-06-29 Thread Aaron Scott
I'm working on a Python application right now that uses a large number of audio assets. Instead of having a directory full of audio, I'd like to pack all the audio into a single file. Is there any easy way to do this in Python? My first instinct was to attempt to pickle all the audio data, but some

Re: Using Python for file packing

2009-06-29 Thread Aaron Scott
> Do you mean like a zip or tar file? > > http://docs.python.org/library/zipfile.htmlhttp://docs.python.org/library/tarfile.html > I had no idea you could access a single file from a ZIP or TAR without explicitly extracting it somewhere. Thanks. -- http://mail.python.org/mailman/listinfo/python-l

Pickling classes -- disappearing lists?

2009-07-13 Thread Aaron Scott
I'm trying to pickle an instance of a class. It mostly works just fine -- I can save the pickle to a file, restore it from that file, and it's mostly okay. The problem is, some lists seem to disappear. For example (snipped and crunched from the code giving me trouble): --- class InitGame:

Re: Memory error due to big input file

2009-07-13 Thread Aaron Scott
> BTW, you should derive all your classes from something.  If nothing > else, use object. >   class textfile(object): Just out of curiousity... why is that? I've been coding in Python for a long time, and I never derive my base classes. What's the advantage to deriving them? -- http://mail.python

Re: Pickling classes -- disappearing lists?

2009-07-13 Thread Aaron Scott
de such a stupid mistake. It's not like I'm a newcomer to Python, either. I'm can't believe I never noticed what I was doing. No more 2am coding for me. Thanks, Aaron -- http://mail.python.org/mailman/listinfo/python-list

WHIFF 0.4 += repoze.who authentication + menus + calculator + docs.

2009-07-14 Thread Aaron Watters
. Documentation index: http://aaron.oirt.rutgers.edu/myapp/docs/W.intro . I hope you like it! -- Aaron Watters === % ping elvis elvis is alive -- http://mail.python.org/mailman/listinfo/python-list

off topic: google groups sucks?

2009-08-17 Thread Aaron Watters
ng? gmane? With all the smart people working at google how can they up like this? Inquiring minds want to know. -- Aaron Watters === Sisyphus got ripped. -- http://mail.python.org/mailman/listinfo/python-list

Re: off topic: google groups sucks?

2009-08-17 Thread Aaron Watters
On Aug 17, 10:05 am, Aaron Watters wrote: > Just a note.  It seems that google groups is increasing the > sucks coefficient. I'm having better luck now using the advanced search option with queries like gadfly group:comp.lang.python which become http://groups.google.com/grou

Re: off topic: google groups sucks?

2009-08-17 Thread Aaron Watters
On Aug 17, 1:44 pm, John Yeung wrote: > Thanks, Aaron, for confirming that it's not just me! yea, unfortunately this kind of thing happens in monopolies that have no viable competition anymore... Sometimes I begin to suspect that I'm seeing the results that I should want rather tha

Re: Data visualization in Python

2009-08-20 Thread Aaron Watters
IFF is a collection of support services for WSGI applications which allows applications to be composed by "dropping" dynamic pages into container directories. http://aaron.oirt.rutgers.edu/myapp/docs/W.intro thanks, -- Aaron Watters === Sisyphus got ripped. -- http://mail.pytho

Problem with arrays in a recursive class function

2009-08-20 Thread Aaron Scott
I have a list of nodes, and I need to find a path from one node to another. The nodes each have a list of nodes they are connected to, set up like this: class Node(object): def __init__(self, connectedNodes): self.connectedNodes = connectedNodes nodes = { 1: Node

Re: Problem with arrays in a recursive class function

2009-08-20 Thread Aaron Scott
Never mind -- ditched the attempt and implemented Dijkstra. -- http://mail.python.org/mailman/listinfo/python-list

WHIFF += Open Flash Charts

2009-09-17 Thread Aaron Watters
script And XML). Project home page: http://whiff.sourceforge.net . Documentation index: http://aaron.oirt.rutgers.edu/myapp/docs/W.intro . I hope you like it! -- Aaron Watters === an apple every 8 hours will keep 3 doctors away -- kliban -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Aaron Watters
se are very pretty. http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1600.openFlashCharts -- Aaron Watters === Tee front: 80 minutes / 16 positions / no protection back: Rutgers Rugby -- http://mail.python.org/mailman/listinfo/python-list

is this whiff/wsgi claim true?

2009-09-25 Thread Aaron Watters
to correct the statement and my knowledge of what else is out there is faulty and incomplete, so please correct me. Thanks, -- Aaron Watters === less is more -- http://mail.python.org/mailman/listinfo/python-list

Re: is this whiff/wsgi claim true?

2009-09-25 Thread Aaron Watters
o note similarities with to modpy/publisher and even CGI but none of these are WSGI components or infrastructures whereas WHIFF is both a WSGI component and an infrastructure. So this is not the counterexample I was looking for. -- Aaron Watters === - She turned me into a newt! - A newt? - ...I g

Problem getting unittest tests for existing project working

2017-07-02 Thread Aaron Gray
I am trying to get distorm3's unittests working but to no avail. I am not really a Python programmer so was hoping someone in the know maybe able to fix this for me. Here's a GitHub issue I have created for the bug :- https://github.com/gdabah/distorm/issues/118 --

Providing a Python wrapper to a C++ type.

2012-10-16 Thread aaron . l . france
n.org/release/2.7.3/extending/newtypes.html Regards, Aaron -- http://mail.python.org/mailman/listinfo/python-list

Re: hi, ive a new mail address (Away from my office until January 2)

2005-12-19 Thread Aaron Del Monte
Thank you for your e-mail. I am away from my office until Monday, January 2. I will respond to your e-mail when I return. Happy Holidays! Aaron * * * * * * * * * * * * * * * * * * * * * * * * * * * Aaron Del Monte Assistant Information Systems Analyst Webmaster, CDFG Marine Region Web Site

Pausing and Unpausing Threads

2007-08-11 Thread Aaron J. M.
: if self.__action is None: self.__action = action I'm worried that this loop may wast some CPU cycles, and wonder if there's a better way through thread synchronization using such things as Events or Conditions. Thank you, Aaron J. M. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pausing and Unpausing Threads

2007-08-12 Thread Aaron J. M.
t(action) #could add code to ensure > #an > execute attribute Thank you very much for your help. :) I'll get to work on this now. Cheers, Aaron J. M. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pausing and Unpausing Threads

2007-08-12 Thread Aaron J. M.
want to do serialization or other kinds of cleanup. Have people encountered something like this before? Thank you, Aaron J. M. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pausing and Unpausing Threads

2007-08-13 Thread Aaron J. M.
m to > finish. Ah, thank you very much. :) - Aaron J. M. -- http://mail.python.org/mailman/listinfo/python-list

Deserializing specific objects from a file

2007-09-18 Thread Aaron J. M.
oes anyone here know what techniques I have to employ here? Thank you, Aaron J. M. P.S. Is it *deserialize* or *unserialize*? -- http://mail.python.org/mailman/listinfo/python-list

Re: Deserializing specific objects from a file

2007-09-19 Thread Aaron J. M.
That's exactly what I needed. Thank you. Aaron J. M. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Aaron "Castironpi" Brady
On Oct 5, 2:12 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > > [EMAIL PROTECTED] wrote: > > > OFFSET = dict(("%x"%i, int(c)) for i,c in enumerate("5433")) > > def get_highe

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Aaron "Castironpi" Brady
On Oct 5, 7:02 pm, Rich Healey <[EMAIL PROTECTED]> wrote: > > P.S.  Back home, this sort of 'nitpicking' would be judged > > unconstructive.  Worth pointing out, or not worth saying? > > > P.S.S.  'Thighest' bit?  I thought the spam filters would catch that. > > That should be P.P.S. > > PS: This i

Re: Python 2.6 / 3.0: Determining if a method is inherited

2008-10-05 Thread Aaron "Castironpi" Brady
On Oct 5, 7:13 pm, MRAB <[EMAIL PROTECTED]> wrote: > Fuzzyman wrote: > > Hello all, > > > I may well be being dumb (it has happened before), but I'm struggling > > to fix some code breakage with Python 2.6. > > > I have some code that looks for the '__lt__' method on a class: > > > if hasattr(clr,

Re: When Python should not be used?

2008-10-05 Thread Aaron "Castironpi" Brady
On Oct 5, 7:08 pm, Andrea Francia <[EMAIL PROTECTED] HERE.ohoihihoihoih.TO-HERE.gmx.it> wrote: > The right tool depends on the current problem. > > While some python users prefer to talk about when Python is the right > tool I think that it is more instructive to know when it is not. > > Please, co

Re: lint for Python?

2008-10-05 Thread Aaron "Castironpi" Brady
On Oct 5, 8:53 am, Pat <[EMAIL PROTECTED]> wrote: > Miki wrote: > > Hello, > > >> In module one, I have a function: > > >> def foo( host, userid, password ): > >>      pass > > >> In module two, I call that function: > > >> foo( userid, password) > > >> lint doesn't find that error and it won't be

Re: Python 2.6 / 3.0: Determining if a method is inherited

2008-10-06 Thread Aaron "Castironpi" Brady
On Oct 6, 4:30 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Oct 6, 1:13 am, MRAB <[EMAIL PROTECTED]> wrote: > > > > > Fuzzyman wrote: > > > Hello all, > > > > I may well be being dumb (it has happened before), but I'm struggling > > > to fix some code breakage with Python 2.6. > > > > I have some c

Re: how to get the thighest bit position in big integers?

2008-10-06 Thread Aaron "Castironpi" Brady
On Oct 6, 3:37 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Oct 5, 11:40 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > > > Your point, that taking floor(log2(x)) is redundant, is a good catch. > > However, you should have added 'untested' ;-).  When value has more > > significant bits than the

Re: Python 2.6 / 3.0: Determining if a method is inherited

2008-10-06 Thread Aaron "Castironpi" Brady
On Oct 6, 1:17 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Oct 6, 7:01 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> > wrote: > > It's a very object oriented solution.  Essentially you're inheriting > > all the classes that you w

Re: Array of dict or lists or ....?

2008-10-07 Thread Aaron "Castironpi" Brady
On Oct 7, 10:16 am, "Barak, Ron" <[EMAIL PROTECTED]> wrote: > Would the following be suitable data structure: > ... > struct = {} > struct["Nebraska"] = "Wabash" > struct["Nebraska"]["Wabash"] = "Newville" > struct["Nebraska"]["Wabash"]["Newville"]["topics"] = "Math" > struct["Nebraska"]["Wabash"][

Re: Race condition when generating .pyc files

2008-10-07 Thread Aaron "Castironpi" Brady
On Oct 7, 10:21 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have a large body of Python code which runs on many different (Unix) > machines concurrently.  Part of the code lives in one place, but most > of it lives in directories which I find at runtime.  I only have one > copy of each P

Re: type-checking support in Python?

2008-10-07 Thread Aaron "Castironpi" Brady
On Oct 7, 5:24 am, Bas <[EMAIL PROTECTED]> wrote: > On Oct 7, 8:36 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] > > central.gen.new_zealand> wrote: > > In message <[EMAIL PROTECTED]>, Gabriel > > > Genellina wrote: > > > As an example, in the oil industry here in my country there is a mix of > > > me

Re: type-checking support in Python?

2008-10-07 Thread Aaron "Castironpi" Brady
On Oct 7, 3:52 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > (e.g., man-day-widgets for > questions like, "If it takes one man three days to make two widgets, how > many widgets can five men make in two weeks?"). Wouldn't that be 'widgets per man-day'? -- http://mail

inspect bug

2008-10-08 Thread Aaron "Castironpi" Brady
Hi all, Found this bug. It's in 2.6, too bad. Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import inspect >>> type( inspect.getargvalues( inspect.currentframe() ) ) Docs say: insp

inspect feature

2008-10-08 Thread Aaron "Castironpi" Brady
Hello, The 'inspect' module has this method: inspect.getargvalues(frame) It takes a frame and returns the parameters used to call it, including the locals as defined in the frame, as shown. >>> def f( a, b, d= None, *c, **e ): ... import inspect ... return inspect.getargvalues( inspect.

Re: Safe eval of insecure strings containing Python data structures?

2008-10-08 Thread Aaron "Castironpi" Brady
On Oct 8, 7:34 pm, "Warren DeLano" <[EMAIL PROTECTED]> wrote: > I would like to parse arbitrary insecure text string containing nested > Python data structures in eval-compatible form:   > ... > # But I know for certain that the above approach is NOT secure since > object attributes can still be ac

Re: how to get the thighest bit position in big integers?

2008-10-08 Thread Aaron "Castironpi" Brady
On Oct 8, 7:21 pm, greg <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: > > str.find is an historical anomaly that should not be copied.  It > > was(is?) a wrapper for C's string find function.  C routinely uses -1 to > > mean None for functions statically typed to return ints.  The Python > > vers

Re: Porn Addiction Solutions?

2008-10-08 Thread Aaron "Castironpi" Brady
On Oct 8, 2:07 pm, [EMAIL PROTECTED] wrote: > Help, I'm addicted to porn. I've been spending a lot of time > downloading hardcore porn and masturbating to it. It's ruining my > life. I just found out that one of these sites somehow hacked my card > and rang up $5K in charges which they won't even r

Re: inspect bug

2008-10-09 Thread Aaron "Castironpi" Brady
On Oct 9, 9:47 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 09 Oct 2008 00:24:20 -0300, Aaron "Castironpi" Brady   > <[EMAIL PROTECTED]> escribió: > > > Found this bug.  It's in 2.6, too bad. > > Posting here is not going

Re: inspect feature

2008-10-09 Thread Aaron "Castironpi" Brady
On Oct 9, 3:48 am, Bruno Desthuilliers wrote: > Aaron "Castironpi" Brady a écrit : > > > > > Hello, > > > The 'inspect' module has this method: > > > inspect.getargvalues(frame) > > > It takes a frame and returns the parameters used

Re: Safe eval of insecure strings containing Python data structures?

2008-10-09 Thread Aaron "Castironpi" Brady
On Oct 9, 1:44 pm, Jason Scheirer <[EMAIL PROTECTED]> wrote: > On Oct 9, 9:01 am, Paul Rubin wrote: > > > Lie Ryan <[EMAIL PROTECTED]> writes: > > > in python 2.6, ast.literal_eval may be used to replace eval() for > > > literals. > > > What happens on literal_eval('[1]*9

Re: Traceback not going all the way to the exception?

2008-10-09 Thread Aaron "Castironpi" Brady
On Oct 9, 3:27 am, sert <[EMAIL PROTECTED]> wrote: > I just got an exception and the traceback wouldn't go all the > way to the statement that threw the exception. I found that out > by using the debugger. > > Contrast the traceback: > > http://tinyurl.com/5xglde > > with the debugger output (notic

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 5:24 am, Gordon Allott <[EMAIL PROTECTED]> wrote: > Hello :) > > The result of various incompatibilities has left me needing to somehow > extract the address that a null pointer is pointing to with the null > pointer being exposed to python via PyCObject_FromVoidPtr > > the code that cre

Re: inspect feature

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 3:36 am, Bruno Desthuilliers wrote: > Aaron "Castironpi" Brady a écrit : > > > > > On Oct 9, 3:48 am, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > >> Aaron "Castironpi" Brady a écrit : > > >>> Hello, > >

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 12:04 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > Did you try: > > > tmp= PyLong_FromLong( ( long ) info.info.x11.display ); > > PyDict_SetItemString (dict, "display", tmp); > > Py_DECREF

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 4:16 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > I see.  If I understand, you have a PyCObject in a dictionary. > > > Look at the 'ctypes' module and try calling PyCObject_AsVoidPtr.  Its > >

Re: Porn Addiction Solutions?

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 10:33 am, Aspersieman <[EMAIL PROTECTED]> wrote: > On Fri, 10 Oct 2008 16:11:07 +0200, <[EMAIL PROTECTED]> wrote: > > On Oct 10, 7:03 am, Um Jammer NATTY <[EMAIL PROTECTED]> wrote: > >> On Oct 10, 5:37 am, [EMAIL PROTECTED] wrote: > > >> > It's very simple. You need to know the world is

Re: Where/how to propose an addition to a standard module?

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 2:10 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > I would like to propose a new method for the string.Template class.   > What's the proper procedure for doing this?  I've joined the python- > ideas list, but that seems to be only for proposed language changes,   > and my idea doesn't req

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 7:59 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > Yes, well said.  But no, not true, not necessarily.  You can choose/ > > change return types with your code.  If the call is defined already > > and you can'

Re: Using multiprocessing

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 3:32 pm, nhwarriors <[EMAIL PROTECTED]> wrote: > I am attempting to use the (new in 2.6) multiprocessing package to > process 2 items in a large queue of items simultaneously. I'd like to > be able to print to the screen the results of each item before > starting the next one. I'm having

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 9, 5:30 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Is there a canonical way to address the bits in a structure > like an array or string or struct? > > Or alternatively, is there a good way to combine eight > ints that represent bits into one of the bytes in some > array or string

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 10:37 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Oct 9, 5:30 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > > > > > Is there a canonical way to address the bits in a structure > > like an arra

Re: Using multiprocessing

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 10:48 pm, nhwarriors <[EMAIL PROTECTED]> wrote: > On Oct 10, 10:52 pm, "Aaron \"Castironpi\" Brady" > > > > <[EMAIL PROTECTED]> wrote: > > On Oct 10, 3:32 pm, nhwarriors <[EMAIL PROTECTED]> wrote: > > > > I am attemp

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 10:54 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > snip > > Last, you > > haven't mentioned an attempt with PyCObject_AsVoidPtr yet: > > > void* PyCObject_AsVoidPtr(PyObject* self) > >     Return

Re: 2to3 refactoring [was Re: Tuple parameter unpacking in 3.x]

2008-10-11 Thread Aaron "Castironpi" Brady
On Oct 11, 2:23 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: snip > I am talking about a clash between *conventions*, where there could be > many argument names of the form a_b which are not intended to be two item > tuples. > > In Python 2.x, when you see the function signatur

Re: extracting null pointer address from PyCObject with ctypes

2008-10-11 Thread Aaron "Castironpi" Brady
On Oct 11, 9:45 am, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > > My pygame install just returns an integer in get_wm_info.  Take a > > look: > > >>>> pygame.display.get_wm_info() > > {'window

Re: extracting null pointer address from PyCObject with ctypes

2008-10-11 Thread Aaron "Castironpi" Brady
On Oct 11, 1:59 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > > What does print pythonapi.PyCObject_AsVoidPtr(display) give you? > > -- > >http://mail.python.org/mailman/listinfo/python-list > > Traceback (most rec

Re: default value in __init__

2008-10-11 Thread Aaron "Castironpi" Brady
On Oct 10, 12:30 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >> I don't think simply re-executing the default argument > >> expression on each call works either: that would confuse at least as > >> many people as the current system. > > > May I ask you why? I think I do

Re: default value in __init__

2008-10-11 Thread Aaron "Castironpi" Brady
On Oct 11, 4:41 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 10 Oct 2008 06:20:35 -0700, bearophileHUGS wrote: snip > > I have seen professional programmers too use class attributes instead of > > instance ones... > > That's only a mistake if you don't mean to use cla

Re: Most compact "X if X else Y" idiom

2008-10-11 Thread Aaron "Castironpi" Brady
On Oct 12, 12:01 am, [EMAIL PROTECTED] wrote: > I find myself having to do the following: > >   x = (some complex expression) >   y = x if x else "blah" > > and I was wondering if there is any built-in idiom that > can remove the need to put (some complex expression) > in the temporary variable x.

Mail reader & spam

2008-10-12 Thread Aaron "Castironpi" Brady
Hello all, I'm hesitating to change news readers because I like Google's interface. In the interests of discussion, I'd make better contributions without it, if only because it's a known spam source, but its reader format beats the alternatives I've seen. I checked out the 'nntplib' module to se

Re: inspect feature

2008-10-14 Thread Aaron "Castironpi" Brady
On Oct 14, 9:42 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Oct 14, 3:06 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > En Fri, 10 Oct 2008 14:18:53 -0300, Aaron "Castironpi" Brady > > <[EMAIL PROTECTED]> escr

Re: inspect feature

2008-10-14 Thread Aaron "Castironpi" Brady
On Oct 14, 2:32 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Oct 14, 2:35 pm, "Aaron \"Castironpi\" Brady" > > > > <[EMAIL PROTECTED]> wrote: > > On Oct 14, 9:42 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > >

Re: default value in __init__

2008-10-14 Thread Aaron "Castironpi" Brady
On Oct 14, 1:50 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > David C. Ullrich a écrit : > > > > > In article <[EMAIL PROTECTED]>, > >  Bruno Desthuilliers <[EMAIL PROTECTED]> > >  wrote: snip > (snip) snip > > In particular default parameters should work the way the user > > expects! The fa

Re: inspect feature

2008-10-14 Thread Aaron "Castironpi" Brady
On Oct 14, 4:16 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Oct 14, 5:00 pm, "Aaron \"Castironpi\" Brady" > > > > <[EMAIL PROTECTED]> wrote: (snip > > Here's some more info. > > > Ver 2.5: > > > >>&g

Re: docpicture

2008-10-14 Thread Aaron "Castironpi" Brady
On Oct 14, 11:56 am, [EMAIL PROTECTED] wrote: > André: > > > Ok, the following is my first attempt at implementing this idea. > > I suggest you to change the program you use to encode your images, > because it's 1000 bytes, while with my program the same 256 colors > image needs just 278 bytes: > >

Re: Overloading operators

2008-10-15 Thread Aaron "Castironpi" Brady
On Oct 15, 7:34 am, Mr.SpOOn <[EMAIL PROTECTED]> wrote: > Hi, > in a project I'm overloading a lot of comparison and arithmetic > operators to make them working with more complex classes that I > defined. > > Sometimes I need a different behavior of the operator depending on the > argument. For exa

Re: File Management

2008-10-15 Thread Aaron "Castironpi" Brady
On Oct 15, 12:47 pm, "erict1689" <[EMAIL PROTECTED]> wrote: > I am writing this program in which I open up a file and update that > information but to a new file.  I already have a global variable for > it but how do I go about creating an openable file in the source code? >  If it helps here is wh

Re: Overloading operators

2008-10-15 Thread Aaron "Castironpi" Brady
On Oct 15, 7:34 am, Mr.SpOOn <[EMAIL PROTECTED]> wrote: > Hi, > in a project I'm overloading a lot of comparison and arithmetic > operators to make them working with more complex classes that I > defined. > > Sometimes I need a different behavior of the operator depending on the > argument. For exa

Re: IDE Question

2008-10-15 Thread Aaron "Castironpi" Brady
On Oct 15, 1:07 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > Steve Phillips wrote: > > Hi All, > > I am just wondering what seems to be the most popular IDE. The reason > > I ask is I am currently at war with myself when it comes to IDE's. It > > seems like every one I find and try out has somethi

Re: How to transfer data structure or class from Python to C/C++?

2008-10-15 Thread Aaron "Castironpi" Brady
On Oct 15, 8:08 pm, Hongtian <[EMAIL PROTECTED]> wrote: > Hi friends, > > I am a newer of Python. I want to ask below question: > > I have a C/C++ application and I want to use Python as its extension. > To do that, I have to transfer some data structure from C/C++ > application to Python and get s

Re: default value in __init__

2008-10-15 Thread Aaron "Castironpi" Brady
On Oct 15, 11:05 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano > wrote: > > > On Thu, 09 Oct 2008 01:39:30 -0700, kenneth (a.k.a. Paolo) wrote: > > >> On Oct 9, 10:14 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > > >

Re: default value in __init__

2008-10-15 Thread Aaron "Castironpi" Brady
On Oct 15, 11:33 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > [about how default argument behavior should, in his opinion, be changed] > > Say what you like. The language is as it is by choice. Were it, for some > reason, to

Re: Finding the instance reference of an object

2008-10-16 Thread Aaron "Castironpi" Brady
On Oct 16, 12:25 pm, Astley Le Jasper <[EMAIL PROTECTED]> wrote: > Thanks for all the responses. That helps. > > Ta > > ALJ If you're sure it's unique, why not just scan through the pairs in locals()? for k, v in locals(): if v is the_object_im_looking_for: name_im_looking_for= k This meth

Re: default value in __init__

2008-10-16 Thread Aaron "Castironpi" Brady
On Oct 16, 1:05 am, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 15, 2008 at 9:43 PM, Aaron Castironpi Brady > > > > <[EMAIL PROTECTED]> wrote: > > On Oct 15, 11:33 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Aaron &q

Re: default value in __init__

2008-10-16 Thread Aaron "Castironpi" Brady
On Oct 16, 12:23 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 16 Oct 2008 17:05:40 +1300, Lawrence D'Oliveiro wrote: > > In message <[EMAIL PROTECTED]>, Steven D'Aprano > > wrote: > > >> On Thu, 09 Oct 2008 01:39:30 -0700, kenneth (a.k.a. Paolo) wrote: > > >>> On Oct

Re: How to transfer data structure or class from Python to C/C++?

2008-10-16 Thread Aaron "Castironpi" Brady
On Oct 16, 9:10 am, Hongtian <[EMAIL PROTECTED]> wrote: > Not exactly. > > In my C/C++ application, I have following function or flow: > > void func1() > { >     call PyFunc(struct Tdemo, struct &Tdemo1); > > } > > I mean I want to invoke Python function 'PyFunc' and transfer a data > structure

Re: default value in __init__

2008-10-16 Thread Aaron "Castironpi" Brady
On Oct 16, 7:54 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 16 Oct 2008 12:18:49 -0700, Aaron \"Castironpi\" Brady wrote: > > [snip] > > >> If Python re-evaluated the default value i=i at runtime, the above > >&

Re: Finding the instance reference of an object

2008-10-16 Thread Aaron "Castironpi" Brady
On Oct 16, 8:30 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 16 Oct 2008 11:51:43 -0700, Aaron \"Castironpi\" Brady wrote: > > If you're sure it's unique, why not just scan through the pairs in > > local

Re: How to transfer data structure or class from Python to C/C++?

2008-10-17 Thread Aaron "Castironpi" Brady
ython function 'PyFunc' and transfer a data > structure 'Tdemo' to this function. After some process in Python, I > want it return 'Tdemo1' back to the C/C++ application. > > I research boost.python and think it is not a reasonable solution > because it make the

Re: How to transfer data structure or class from Python to C/C++?

2008-10-17 Thread Aaron "Castironpi" Brady
ython function 'PyFunc' and transfer a data > structure 'Tdemo' to this function. After some process in Python, I > want it return 'Tdemo1' back to the C/C++ application. > > I research boost.python and think it is not a reasonable solution > because it make the

Re: default value in __init__

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 6:56 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 17 Oct 2008 23:04:52 +1300, Lawrence D'Oliveiro wrote: > > In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > > >> We already get people asking why code like this doesn't return 3: > > > fns = [ lambd

Re: Normalizing arguments

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 12:37 pm, Dan Ellis <[EMAIL PROTECTED]> wrote: > On Oct 17, 6:17 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > > > Why do you want/need this magical g() function considering that, as > > you yourself point out, Python already performs this normalization for > > you? > > A caching idea

<    4   5   6   7   8   9   10   11   >