New submission from João Bernardo jbv...@gmail.com:
Hi, I'm working on a class which implements the __contains__ method but the way
I would like it to work is by generating an object that will be evaluated later.
It'll return a custom object instead of True/False
class C:
def
Georg Brandl ge...@python.org added the comment:
an object is true is a short way of saying bool(obj) is True. So the docs
match the behavior.
Returning the actual object instead of True/False from the in operator is a
feature request.
--
assignee: docs@python -
nosy: +georg.brandl
João Bernardo jbv...@gmail.com added the comment:
@Georg Brandl
Oh sorry, now I see... true != True
But still, why is that the default behavior? Shouldn't it use whatever the
method returns?
--
type: enhancement - behavior
versions: +Python 3.2
___
Changes by João Bernardo jbv...@gmail.com:
--
type: behavior - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13667
___
___
Georg Brandl ge...@python.org added the comment:
Well, usually what you want *is* a boolean indicating whether the element is in
the collection or not.
Being able to overload in, mostly for metaprogramming purposes, is a request
that probably nobody thought of when implementing in.
Changes by Anthony Kong anthony.hw.k...@gmail.com:
--
nosy: +Anthony.Kong
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13641
___
___
Zbyszek Szmek zbys...@in.waw.pl added the comment:
Seems to work also on kfreebsd/debian (with eglibc).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13609
___
New submission from Zhiping Deng kofreesty...@gmail.com:
If python was configured without-threads:
% ./python
Python 2.7.2+ (2.7:e71e4bd45c89, Dec 28 2011, 21:03:59)
[GCC 4.4.3] on linux2
Type help, copyright, credits or license for more information.
import dummy_threading as _threading
a =
New submission from Zbyszek Szmek zbys...@in.waw.pl:
Extended attribute support was added in issue 12720. Doesn't compile on
kfreebsd/debian, which uses eglibc and gcc. The error is that the symbols
XATTR_LIST_MAX and XATTR_SIZE_MAX are not defined.
After
Changes by Antoine Pitrou pit...@free.fr:
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13609
___
___
New submission from andrea crotti andrea.crott...@gmail.com:
This patch increases test coverage for pstats.py from 25 to 36%.
It's my first proposed patch so sorry in advance if there are problems. Much
more can be done for pstats.py (which is also not much commented) but I want to
get some
Changes by Brian Curtin br...@python.org:
--
nosy: +brian.curtin
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13670
___
Georg Brandl ge...@python.org added the comment:
I don't understand this comment:
+#TODO: add more complicated tests, which might almost compile
Also, please don't use docstrings for the test methods because of unittest's
feature to display them instead of the test method names.
andrea crotti andrea.crott...@gmail.com added the comment:
It's really hard to understand true, and if should not go in the patch in
general of course.
The sense was that the only test I added is trivial, but I haven't produced
something better yet.
And ok I will remove the docstrings, I was
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset a7744f778646 by Jason R. Coombs in branch 'default':
Limit test scope to those platforms that can save the target filenames.
Reference #11638.
http://hg.python.org/cpython/rev/a7744f778646
--
Jason R. Coombs jar...@jaraco.com added the comment:
I've limited the scope of the patch to attempt to only test on those platforms
that can actually create unicode-named files. I'll watch the buildbots to see
if that corrects the failures (since I don't have the failing platforms
available
Benjamin Peterson benja...@python.org added the comment:
Are you telling me that XATTR_SIZE_MAX is defined nowhere on eglibc?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13669
___
Benjamin Peterson benja...@python.org added the comment:
I think the idea has some merit. I think it should be well vetted on
python-ideas, though. One thing that will certianly weigh against it is that
implementation would not be trivial.
--
___
Changes by Nikolaus Rath nikol...@rath.org:
--
nosy: -Nikratio
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5689
___
___
Python-bugs-list
Zbyszek Szmek zbys...@in.waw.pl added the comment:
Unless I'm completely confused, XATTR_SIZE_MAX is defined by linux kernel
headers, not the libc.
On my linux debian box:
$ grep -r XATTR_SIZE_MAX -I /usr
include/linux/limits.h:#define XATTR_SIZE_MAX 65536
$ dpkg -l libc6
libc6
Zbyszek Szmek zbys...@in.waw.pl added the comment:
Forgot to add (on the fedora box):
$ rpm -q glibc
glibc-2.14.90-13.x86_64
(The GNU libc libraries from http://www.gnu.org/software/glibc/)
So the glibc/eglibc split is not important here.
--
___
Antoine Pitrou pit...@free.fr added the comment:
On my linux debian box:
$ grep -r XATTR_SIZE_MAX -I /usr
include/linux/limits.h:#define XATTR_SIZE_MAX 65536
$ dpkg -l libc6
libc6 2.11.2-10 Embedded GNU C Library: Shared libraries
$ dpkg -S /usr/include/linux/limits.h
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 9b681e0c04ed by Jason R. Coombs in branch '2.7':
Limit test scope to those platforms that can save the target filenames.
Reference #11638.
http://hg.python.org/cpython/rev/9b681e0c04ed
--
Jason R. Coombs jar...@jaraco.com added the comment:
The changes to the default branch seem to have cleaned up the test failures on
most platforms (still waiting on the ARM results). So I've backported the test
skips to the Python 2.7 branch as well.
--
Zbyszek Szmek zbys...@in.waw.pl added the comment:
Yes, it must be, because XATTR_SIZE_MAX is only defined in
linux/limits.h. The problem is that with the kfreebsd kernel,
/usr/include/sys/limits.h doesn't define or include anything that
defines XATTR_SIZE_MAX.
Maybe the test should be
João Bernardo jbv...@gmail.com added the comment:
I see that every other comparison operator (, , =, =, ==, !=) except for
`is` work the way I expect and is able to return anything.
e.g.
numpy.arange(5) 3
array([ True, True, True, False, False], dtype=bool)
I didn't checked the code (and
Benjamin Peterson benja...@python.org added the comment:
2011/12/28 João Bernardo rep...@bugs.python.org:
João Bernardo jbv...@gmail.com added the comment:
I see that every other comparison operator (, , =, =, ==, !=) except for
`is` work the way I expect and is able to return anything.
Stefan Krah stefan-use...@bytereef.org added the comment:
So the problem occurs on:
http://www.debian.org/ports/kfreebsd-gnu/
Did I get that right? Is __FreeBSD__ defined on that system?
I'm not sure though if we should start supporting hybrid systems.
--
New submission from Александр Балезин geschei...@gmail.com:
In conf file:
keyе_ = ,,
Get next exception:
File /usr/lib/python2.6/dist-packages/configobj.py, line 1230, in __init__
self._load(infile, configspec)
File /usr/lib/python2.6/dist-packages/configobj.py, line 1306, in _load
João Bernardo jbv...@gmail.com added the comment:
Using my poor grep abilities I found that on Objects/typeobject.c
(I replaced some declarations/error checking from the code with ...)
static int
slot_sq_contains(PyObject *self, PyObject *value) {
...
func = lookup_maybe(self,
Zbyszek Szmek zbys...@in.waw.pl added the comment:
That's the one.
No. I'm putting the complete list below.
Actually python2.5-7 and 3.2 is normally packaged by debian for
is arch, so it mostly works.
$ gcc -dM -E - /dev/null
#define __DBL_MIN_EXP__ (-1021)
#define __UINT_LEAST16_MAX__ 65535
Georg Brandl ge...@python.org added the comment:
It's defined that way because it's a slot returning a bool, so it doesn't need
to return anything except for 0 or 1.
Changing this to return a PyObject would mean that every extension module (i.e.
module written in C) that defines a custom
James B skilletau...@gmail.com added the comment:
I have encountered this issue(python 2.7) with respect to positional arguments
that begin with a dash (linux/ bash).
In the following example, the parser requires three positional arguments. I
attempted to encase the arguments in single-quotes
Changes by Hynek Schlawack h...@ox.cx:
Added file: http://bugs.python.org/file24099/23e6204efe20.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12715
___
Hynek Schlawack h...@ox.cx added the comment:
Added another patch fixing the issues pointed out by Antoine and
Charles-François.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12715
___
New submission from Arfrever Frehtes Taifersar Arahesis
arfrever@gmail.com:
PEP 3155 added qualified name as __qualname__ attribute in classes and
functions. It would be useful if qualified name was also available as
co_qualname attribute of code objects.
import sys
class A:
...
Eric Snow ericsnowcurren...@gmail.com added the comment:
with f_func (see #12857) you would get that for free:
frame.f_func.__qualname__
'A.f1'
--
nosy: +eric.snow
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13672
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
-1 on this proposal. It has everyone paying a price for a questionable feature
that would benefit very few.
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
Alex Gaynor alex.gay...@gmail.com added the comment:
For what it's worth I proposed this on -ideas a while ago, the sticking points
were what does `not in` do (no one had an answer anyone was happy with for
this), and do we need a way to override it from the other perspective (e.g. if
I want
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12857
___
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:
co_qualname could still be useful if somebody has code object without frame
object.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13672
Eric Snow ericsnowcurren...@gmail.com added the comment:
True. I wonder, though if perhaps a co_func (as a weak ref) or co_orig_func
would be better, since co_qualname would be built from the original function
anyway. Then you could call code.co_func.func_qualname.
One sticky point is that
Zbyszek Szmek zbys...@in.waw.pl added the comment:
[Why does roundup remove quoted text being replied to???]
On 12/28/2011 06:05 PM, Stefan Krah wrote:
http://www.debian.org/ports/kfreebsd-gnu/
That's the one.
Is __FreeBSD__ defined on that system?
No. I'm putting the complete list below.
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13609
___
New submission from sbt shibt...@gmail.com:
If SIGINT arrives while a function implemented in C is executing, then it
prevents the function from raising an exception unless the function first calls
PyErr_CheckSignals(). (If the function returns an object (instead of NULL)
then
Anders Kaseorg ande...@mit.edu added the comment:
James: That’s not related to this issue. This issue is about options taking
arguments beginning with dash (such as a2x --asciidoc-opts --safe, where --safe
is the argument to --asciidoc-opts), not positional arguments beginning with
dash.
João Bernardo jbv...@gmail.com added the comment:
The problem with `not in` is because it must evaluate the result. It's not just
another operator like == and !=.
Looks like we're suffering from premature optimization and now it would break a
lot of code to make it good.
For my application,
Changes by Benjamin Peterson benja...@python.org:
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13667
___
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13672
___
___
Python-bugs-list mailing list
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12857
___
___
Python-bugs-list mailing list
Changes by Meador Inge mead...@gmail.com:
--
nosy: +meador.inge
stage: - needs patch
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13672
___
Antoine Pitrou pit...@free.fr added the comment:
New prototype with per-module import locks and deadlock avoidance.
When a deadlock due to threaded circular imports is detected, the offending
import returns the partially constructed module object (as would happen in
single-threaded mode).
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13668
___
___
Python-bugs-list
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +haypo
stage: needs patch - patch review
versions: +Python 3.3 -Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13508
___
54 matches
Mail list logo