[issue13667] __contains__ method behavior

2011-12-28 Thread João Bernardo
New submission from João Bernardo : 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 __contains__(self, x):

[issue13667] __contains__ method behavior

2011-12-28 Thread Georg Brandl
Georg Brandl 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 type: beh

[issue13667] __contains__ method behavior

2011-12-28 Thread João Bernardo
João Bernardo 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 ___ Python tracker

[issue13667] __contains__ method behavior

2011-12-28 Thread João Bernardo
Changes by João Bernardo : -- type: behavior -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue13667] __contains__ method behavior

2011-12-28 Thread Georg Brandl
Georg Brandl 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". -- nosy: +benj

[issue13641] decoding functions in the base64 module could accept unicode strings

2011-12-28 Thread Anthony Kong
Changes by Anthony Kong : -- nosy: +Anthony.Kong ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue13609] Add "os.get_terminal_size()" function

2011-12-28 Thread Zbyszek Szmek
Zbyszek Szmek added the comment: Seems to work also on kfreebsd/debian (with eglibc). -- ___ Python tracker ___ ___ Python-bugs-list

[issue13668] mute ImportError in __del__ of _threading_local module

2011-12-28 Thread Zhiping Deng
New submission from Zhiping Deng : 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 = _threadin

[issue13669] XATTR_SIZE_MAX and XATTR_LIST_MAX undefined on kfreebsd/debian with eglibc

2011-12-28 Thread Zbyszek Szmek
New submission from Zbyszek Szmek : 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 http://hg.python.org/cpython/rev/f325439d7f84 xattr com

[issue13609] Add "os.get_terminal_size()" function

2011-12-28 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue13670] Increase test coverage for pstats.py

2011-12-28 Thread andrea crotti
New submission from andrea crotti : 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 feedback on this first.. -

[issue13670] Increase test coverage for pstats.py

2011-12-28 Thread Brian Curtin
Changes by Brian Curtin : -- nosy: +brian.curtin stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue13670] Increase test coverage for pstats.py

2011-12-28 Thread Georg Brandl
Georg Brandl 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. -- nosy: +ge

[issue13670] Increase test coverage for pstats.py

2011-12-28 Thread andrea crotti
andrea crotti 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 actually doing it on purp

[issue11638] python setup.py sdist --formats tar* crashes if version is unicode

2011-12-28 Thread Roundup Robot
Roundup Robot 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 -- ___ Python

[issue11638] python setup.py sdist --formats tar* crashes if version is unicode

2011-12-28 Thread Jason R. Coombs
Jason R. Coombs 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 to me). --

[issue13669] XATTR_SIZE_MAX and XATTR_LIST_MAX undefined on kfreebsd/debian with eglibc

2011-12-28 Thread Benjamin Peterson
Benjamin Peterson added the comment: Are you telling me that XATTR_SIZE_MAX is defined nowhere on eglibc? -- ___ Python tracker ___ _

[issue13667] __contains__ method behavior

2011-12-28 Thread Benjamin Peterson
Benjamin Peterson 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. -- ___ Python tracker

[issue5689] Support xz compression in tarfile module

2011-12-28 Thread Nikolaus Rath
Changes by Nikolaus Rath : -- nosy: -Nikratio ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue13669] XATTR_SIZE_MAX and XATTR_LIST_MAX undefined on kfreebsd/debian with eglibc

2011-12-28 Thread Zbyszek Szmek
Zbyszek Szmek 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 2.11.2-10 Embedded

[issue13669] XATTR_SIZE_MAX and XATTR_LIST_MAX undefined on kfreebsd/debian with eglibc

2011-12-28 Thread Zbyszek Szmek
Zbyszek Szmek 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. -- ___ Python tracker

[issue13669] XATTR_SIZE_MAX and XATTR_LIST_MAX undefined on kfreebsd/debian with eglibc

2011-12-28 Thread Antoine Pitrou
Antoine Pitrou 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 > linux-libc-dev

[issue11638] python setup.py sdist --formats tar* crashes if version is unicode

2011-12-28 Thread Roundup Robot
Roundup Robot 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 -- ___ Python tra

[issue11638] python setup.py sdist --formats tar* crashes if version is unicode

2011-12-28 Thread Jason R. Coombs
Jason R. Coombs 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. -- ___ Python t

[issue13669] XATTR_SIZE_MAX and XATTR_LIST_MAX undefined on kfreebsd/debian with eglibc

2011-12-28 Thread Zbyszek Szmek
Zbyszek Szmek 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 'defined(HAVE_SYS_XATTR_

[issue13667] __contains__ method behavior

2011-12-28 Thread João Bernardo
João Bernardo 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 probably

[issue13667] __contains__ method behavior

2011-12-28 Thread Benjamin Peterson
Benjamin Peterson added the comment: 2011/12/28 João Bernardo : > > João Bernardo 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,

[issue13669] XATTR_SIZE_MAX and XATTR_LIST_MAX undefined on kfreebsd/debian with eglibc

2011-12-28 Thread Stefan Krah
Stefan Krah 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. -- ___ Python track

[issue13671] double comma cant be parsed in config module

2011-12-28 Thread Александр Балезин
New submission from Александр Балезин : 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 self._parse(infi

[issue13667] __contains__ method behavior

2011-12-28 Thread João Bernardo
João Bernardo 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, "__contains__", &contains_

[issue13669] XATTR_SIZE_MAX and XATTR_LIST_MAX undefined on kfreebsd/debian with eglibc

2011-12-28 Thread Zbyszek Szmek
Zbyszek Szmek 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 #define __FLT_MI

[issue13667] __contains__ method behavior

2011-12-28 Thread Georg Brandl
Georg Brandl 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 __contains__ would ne

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-12-28 Thread James B
James B 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 as that is expected in

[issue12715] Add symlink support to shutil functions

2011-12-28 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24099/23e6204efe20.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue12715] Add symlink support to shutil functions

2011-12-28 Thread Hynek Schlawack
Hynek Schlawack added the comment: Added another patch fixing the issues pointed out by Antoine and Charles-François. -- ___ Python tracker ___

[issue13672] Add co_qualname attribute in code objects

2011-12-28 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis : 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: ... def f1(): ...

[issue13672] Add co_qualname attribute in code objects

2011-12-28 Thread Eric Snow
Eric Snow 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 ___ _

[issue13667] __contains__ method behavior

2011-12-28 Thread Raymond Hettinger
Raymond Hettinger 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 __

[issue13667] __contains__ method behavior

2011-12-28 Thread Alex Gaynor
Alex Gaynor 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 to do `SpecialObj() in

[issue12857] Expose called function on frame object

2011-12-28 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue13672] Add co_qualname attribute in code objects

2011-12-28 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: co_qualname could still be useful if somebody has code object without frame object. -- ___ Python tracker ___ ___

[issue13672] Add co_qualname attribute in code objects

2011-12-28 Thread Eric Snow
Eric Snow 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 there isn't a guarantee of

[issue13669] XATTR_SIZE_MAX and XATTR_LIST_MAX undefined on kfreebsd/debian with eglibc

2011-12-28 Thread Zbyszek Szmek
Zbyszek Szmek 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. > I'm not sure th

[issue13609] Add "os.get_terminal_size()" function

2011-12-28 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue13673] SIGINT prevents raising of exceptions unless PyErr_CheckSignals() called

2011-12-28 Thread sbt
New submission from sbt : 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 KeyboardInterrupt is raised as ex

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-12-28 Thread Anders Kaseorg
Anders Kaseorg 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. Your observation i

[issue13667] __contains__ method behavior

2011-12-28 Thread João Bernardo
João Bernardo 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, I created a d

[issue13667] __contains__ method behavior

2011-12-28 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing

[issue13672] Add co_qualname attribute in code objects

2011-12-28 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue12857] Expose called function on frame object

2011-12-28 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13672] Add co_qualname attribute in code objects

2011-12-28 Thread Meador Inge
Changes by Meador Inge : -- nosy: +meador.inge stage: -> needs patch type: -> enhancement ___ Python tracker ___ ___ Python-bugs-lis

[issue9260] A finer grained import lock

2011-12-28 Thread Antoine Pitrou
Antoine Pitrou 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). Probably lacks a t

[issue13668] mute ImportError in __del__ of _threading_local module

2011-12-28 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue13508] ctypes' find_library breaks with ARM ABIs

2011-12-28 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo stage: needs patch -> patch review versions: +Python 3.3 -Python 2.6 ___ Python tracker ___ __