Compiling python without ssl?

2011-04-01 Thread Austin Bingham
Is there any way to compile python (3.1.3, in case it matters) without ssl support? OpenSSL is on my system, and configure finds it, but I can't find a way to tell configure to explicitly ignore it. I need a version of python without ssl for trade compliance reasons (I don't make the dumb rules, I

Python users in Stavanger, Norway?

2011-04-03 Thread Austin Bingham
Hei! I'm a Python developer in Stavanger, Norway looking for other Python users/developers/etc. who might be interested in starting a local user group. Anyone interested? This group might actually evolve into a general programming/computer group, depending on the mix of people, but I think that's

Some C-API functions clear the error indicator?

2010-01-29 Thread Austin Bingham
I've noticed that several (many?) python functions seem to clear the error/exception indicators when they're called from a C/C++ program. For example, both PyImport_ImportModule and traceback.extract_tb() (called via the function call methods) do this: if error indicators are set prior to their cal

Re: Some C-API functions clear the error indicator?

2010-01-29 Thread Austin Bingham
s issue by checking function calls for failure? Austin On Fri, Jan 29, 2010 at 9:04 PM, Gabriel Genellina wrote: > En Fri, 29 Jan 2010 11:37:09 -0300, Austin Bingham > escribió: > >> I've noticed that several (many?) python functions seem to clear the >> error/exception indic

Re: Some C-API functions clear the error indicator?

2010-01-29 Thread Austin Bingham
ption separately. The predicate that "a successful function won't modify the error indicators" appears to be wrong, however, and I've modified my code accordingly. Austin On Sat, Jan 30, 2010 at 1:11 AM, Gabriel Genellina wrote: > En Fri, 29 Jan 2010 18:25:14 -0300, Austin

Re: Some C-API functions clear the error indicator?

2010-01-29 Thread Austin Bingham
That makes a lot of sense. And if I take the approach that any Py* function might do this, it actually looks like I can simplify my code (rather than managing some list of ill-behaved functions or something.) Thanks! On Fri, Jan 29, 2010 at 3:58 PM, Duncan Booth wrote: > Austin Bingham wr

Walking an object/reference graph

2009-10-05 Thread Austin Bingham
I'm looking for the proper way to "walk" a graph of python objects. My specific task is to find all objects of a given type that are referred to (transitively) by some starting object. My approach has been to loop through the object's attributes, examining each, and then recursing on them. This ap

set using alternative hash function?

2009-10-15 Thread Austin Bingham
s, say, 'hash(x.name)' rather than 'hash(x)'. Is this possible? Am I just thinking about this problem the wrong way? Admittedly, I'm coming at this from a C++/STL perspective, so perhaps I'm just missing the obvious. Thanks for any help on this. Austin Bingham -- http://mail.python.org/mailman/listinfo/python-list

Re: set using alternative hash function?

2009-10-15 Thread Austin Bingham
a good one, but it's just not what I am looking for. Austin On Thu, Oct 15, 2009 at 1:36 PM, Chris Rebert wrote: > On Thu, Oct 15, 2009 at 4:24 AM, Austin Bingham > wrote: >> If I understand things correctly, the set class uses hash() >> universally to calculate hash valu

Re: set using alternative hash function?

2009-10-15 Thread Austin Bingham
I guess we see things differently. I think it's quite natural to want a set of unique objects where "unique" is defined as an operation on some subset/conflation/etc. of the attributes of the elements. That's all that the regular set class is, except that it always uses the hash() function to calcu

set using alternative hash function?

2009-10-15 Thread Austin Bingham
On Thu, Oct 15, 2009 at 2:23 PM, Diez B. Roggisch wrote: > Austin Bingham wrote: > This is a POV, but to to me, the set just deals with a very minimal > protocol - hash-value & equality. Whatever you feed it, it has to cope with > that. It strikes *me* as odd to ask for somethin

Re: set using alternative hash function?

2009-10-15 Thread Austin Bingham
On Thu, Oct 15, 2009 at 3:02 PM, Diez B. Roggisch wrote: > Austin Bingham wrote: > You do. Hashes can collide, and then you need equality. Sets are *based* on > equality actually, the hash is just one optimization. ... Right, thanks for clearing that up. Not reading closely enough

Re: set using alternative hash function?

2009-10-15 Thread Austin Bingham
On Thu, Oct 15, 2009 at 3:43 PM, Diez B. Roggisch wrote: > The context-decider isn't the same thing because it isn't designed yet :) > And most probably won't ever be. It's just the abstract idea that > hashing/equality change for one object depending on the circumstances they > are used in, and t

Re: set using alternative hash function?

2009-10-15 Thread Austin Bingham
On Thu, Oct 15, 2009 at 3:50 PM, Mick Krippendorf wrote: > Austin Bingham schrieb: > What you seem to imply is that the hash function imposes some kind of > uniqueness constraint on the set which uses it. That's just not the > case, the uniqueness constraint is always the (in-)eq

Re: set using alternative hash function?

2009-10-15 Thread Austin Bingham
On Thu, Oct 15, 2009 at 4:06 PM, Anthony Tolle wrote: > Why not use a dict?  The key would be the object name.  Pretty much > the same behavior as a set (via the key), and you can still easily > iterate over the objects. To reiterate, dict only gets me part of what I want. Whereas a set with uniq

Re: set using alternative hash function?

2009-10-15 Thread Austin Bingham
On Thu, Oct 15, 2009 at 5:15 PM, Gabriel Genellina wrote: > En Thu, 15 Oct 2009 11:42:20 -0300, Austin Bingham > escribió: > I think you didn't understand correctly Anthony Tolle's suggestion: > > py> class Foo: > ...   def __init__(self, name): self.name = na

Re: set using alternative hash function?

2009-10-15 Thread Austin Bingham
On Thu, Oct 15, 2009 at 7:05 PM, Anthony Tolle wrote: > I wrote a quick subclass of set that does something similar, but uses > just one function for the object uniqueness: > > class MySet(set): >    def __init__(self, iterable = (), idfunc = lambda x: x): >        self.idfunc = idfunc >        se

Re: set using alternative hash function?

2009-10-15 Thread Austin Bingham
On Thu, Oct 15, 2009 at 7:49 PM, Ethan Furman wrote: > Austin Bingham wrote: > I'm feeling really dense about now... What am I missing? What you're missing is the entire discussion up to this point. I was looking for a way to use an alternative uniqueness criteria in a set

Re: set using alternative hash function?

2009-10-15 Thread Austin Bingham
On Thu, Oct 15, 2009 at 8:10 PM, Anthony Tolle wrote: > I think that without a practical example of what this would be used > for, we're all going to be a little lost on this one. > > So far, we've not seen the original problem, only the author's > preferred method for solving it.  My guess is the

Re: C/C++ Import

2010-02-07 Thread Austin Bingham
Does the 'python' directory contain a file named '__init__.py'? This is required to let that directory act as a package (see: http://docs.python.org/tutorial/modules.html#packages); without it, you'll see the symptoms you're seeing. Austin On Mon, Feb 8, 2010 at 4:56 AM, 7H3LaughingMan wrote: >

Re: C/C++ Import

2010-02-08 Thread Austin Bingham
Just to elaborate on Terry's point a bit, sys.path is influenced (in part) by the PYTHONPATH environment variable. If you find that the directory containing 'python' is not in sys.path (which you can check with 'import sys; print sys.path'), add that directory to PYTHONPATH and try again. This may

Crypto and export laws

2009-09-24 Thread Austin Bingham
I'm trying to get a handle on how python intersects with crypto-related export control laws in the US and elsewhere. My current understanding, per the PSF's wiki, is that any crypto related and potentially export-sensitive code is in the ssl wrapper, and that, in fact, this only links to the actual