[Python-Dev] why is mmap a builtin module on windows?

2008-01-22 Thread Ralf Schmitt
Hi all, I want to use the mmap module from python trunk with python 2.5. On Linux I can easily replace it, as it is a dynamically loaded module. On windows it is a builtin module and I fear that I must compile python on windows (or resort to some other ugly hack) What is the reason for mmap being

Re: [Python-Dev] #! magic

2008-01-22 Thread Christian Heimes
M.-A. Lemburg wrote: >> sys.flags(debug=0, py3k_warning=0, division_warning=0, division_new=0, >> inspect=-2147483647, interactive=-2147483647, optimize=0, >> dont_write_bytecode=0, no_user_site=1, no_site=0, ingnore_environment=1, > > Is this a copy&paste error or a typo in the code ^ ? It's

Re: [Python-Dev] 2.5.2 release coming up

2008-01-22 Thread Stephen J. Turnbull
Brett Cannon writes: > On Jan 22, 2008 8:47 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > A reminder: 2.5.2 should only get bugfixes, new features. > > If Guido felt like dragging the time machine out he would catch his > mistake and have that say "NO new features". What, nothing abou

Re: [Python-Dev] Rational approximation methods

2008-01-22 Thread Jeffrey Yasskin
On Jan 20, 2008 5:54 PM, Tim Peters <[EMAIL PROTECTED]> wrote: > What would be useful is a method that generates (i.e., a generator in > the Python sense) the (continued fraction) convergents to a rational. > People wanting specific constraints on a rational approximation > (including, but not limi

Re: [Python-Dev] 2.5.2 release coming up

2008-01-22 Thread Brett Cannon
On Jan 22, 2008 8:47 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > While the exact release schedule for 2.5.2 is still up in the air, I > expect that it will be within a few weeks. This means that we need to > make sure that anything that should go into 2.5.2 goes in ASAP, > preferably this wee

[Python-Dev] 2.5.2 release coming up

2008-01-22 Thread Guido van Rossum
While the exact release schedule for 2.5.2 is still up in the air, I expect that it will be within a few weeks. This means that we need to make sure that anything that should go into 2.5.2 goes in ASAP, preferably this week. It also means that we should be very careful what goes in though -- and we

Re: [Python-Dev] misbehaving __contains__

2008-01-22 Thread Raymond Hettinger
>> And, would we lose the nice relationship expressed by: >> >> for elem in container: >> assert elem in container [Steven Bethard] >We've already lost this if anyone really wants to break it:: > >>>> class C(object): >... def __iter__(self): >... return iter(x

Re: [Python-Dev] misbehaving __contains__

2008-01-22 Thread Steven Bethard
On Jan 22, 2008 5:40 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [Daniel Stutzbach] > > There are many places in the C implementation where a slot > > returns an int rather than a PyObject. There other replies > > in this thread seem to support altering the signature of the > > slot to retu

Re: [Python-Dev] misbehaving __contains__

2008-01-22 Thread Raymond Hettinger
[Daniel Stutzbach] > There are many places in the C implementation where a slot > returns an int rather than a PyObject. There other replies > in this thread seem to support altering the signature of the > slot to return a PyObject. Is this setting a precedent that > _all_ slots should return

Re: [Python-Dev] misbehaving __contains__

2008-01-22 Thread Guido van Rossum
On Jan 22, 2008 3:46 PM, Daniel Stutzbach <[EMAIL PROTECTED]> wrote: > On Jan 22, 2008 1:26 PM, tomer filiba <[EMAIL PROTECTED]> wrote: > > >>> class Foo(object): > > ... def __contains__(self, key): > > ... return 17 > > ... def __eq__(self, other): > > ... return 1

Re: [Python-Dev] misbehaving __contains__

2008-01-22 Thread Daniel Stutzbach
On Jan 22, 2008 1:26 PM, tomer filiba <[EMAIL PROTECTED]> wrote: > >>> class Foo(object): > ... def __contains__(self, key): > ... return 17 > ... def __eq__(self, other): > ... return 19 > ... > >>> > >>> f=Foo() > >>> f == 8 > 19 > >>> 8 in f > True There are many

Re: [Python-Dev] #! magic

2008-01-22 Thread M.-A. Lemburg
On 2008-01-20 19:30, Christian Heimes wrote: > Yet another python executable could solve the issue, named "pythons" as > python secure. > > /* >gcc -DNDEBUG -g -O2 -Wall -Wstrict-prototypes -IInclude -I. -pthread >-Xlinker -lpthread -ldl -lutil -lm -export-dynamic -o pythons2.6 > >py

Re: [Python-Dev] misbehaving __contains__

2008-01-22 Thread Guido van Rossum
The issue is that the sq_contains slot is defined as returning an int, while the tp_richcompare slot is defined as returning a PyObject *. Your first opportunity for changing this will be Py3k. Please submit a patch! On Jan 22, 2008 11:26 AM, tomer filiba <[EMAIL PROTECTED]> wrote: > i'm using py

Re: [Python-Dev] misbehaving __contains__

2008-01-22 Thread Chuck Mason (Visual Concepts)
My guess is that results from the bottom of cmp_outcome (ceval.c), The default case handles the PyCmp_EQ case via PyObject_RichCompare, which might not return Py_True or Py_False. But 'in' is handled inside the switch and is subject to the final statements: v = res ? Py_True : Py_False;

[Python-Dev] misbehaving __contains__

2008-01-22 Thread tomer filiba
i'm using python to create expression objects, for more intuitive usage as predicates, for instance: x = (Arg(0) > 17) & (Arg(1).foo == "bar") instead of x = And(Gt(Arg(0), 17), Eq(GetAttr(Arg(1), "foo"), "bar")) so now i can use x.eval(18, "spam") and get the result of the expression. i'

Re: [Python-Dev] PEP: per user site-packages directory

2008-01-22 Thread Phillip J. Eby
At 04:42 PM 1/22/2008 +0100, M.-A. Lemburg wrote: >I don't really understand what all this has to do with per user >site-packages. > >Note that the motivation for having per user site-packages >was to: > > * address a common request by Python extension package users, > > * get rid off the hackery

Re: [Python-Dev] PEP: per user site-packages directory

2008-01-22 Thread Christian Heimes
M.-A. Lemburg wrote: > I don't really understand what all this has to do with per user > site-packages. > > Note that the motivation for having per user site-packages > was to: > > * address a common request by Python extension package users, > > * get rid off the hackery done by setuptools in

Re: [Python-Dev] PEP: per user site-packages directory

2008-01-22 Thread M.-A. Lemburg
I don't really understand what all this has to do with per user site-packages. Note that the motivation for having per user site-packages was to: * address a common request by Python extension package users, * get rid off the hackery done by setuptools in order to provide this. As such the

Re: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows

2008-01-22 Thread Mark Hammond
Hi Martin, Way back on Monday, 21 May 2007, you wrote: > This is an issue to be discussed for Python 2.6. I'm personally > hesitant to have the "official" build infrastructure deviate > from the layout that has been in-use for so many years, as a lot > of things depend on it. > > I don't find