[issue13062] Introspection generator and function closure state

2011-09-30 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue13062> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13264] Monkeypatching using metaclass

2011-10-25 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue13264> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13264] Monkeypatching using metaclass

2011-10-25 Thread Daniel Urban
Daniel Urban added the comment: > class Meta(ABCMeta): > def __instancecheck__(cls, instance): > # monkeypatching class method > cls.__subclasscheck__ = super(Meta, cls).__subclasscheck__ This line is approximately the same as: cls.__dict__['

[issue13266] Add inspect.unwrap(f) to easily unravel "__wrapped__" chains

2011-10-26 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue13266> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13264] Monkeypatching using metaclass

2011-11-12 Thread Daniel Urban
Daniel Urban added the comment: > It seems to me this is not a bug. +1 -- ___ Python tracker <http://bugs.python.org/issue13264> ___ ___ Python-bugs-list mai

[issue11610] Improved support for abstract base classes with descriptors

2011-06-11 Thread Daniel Urban
Daniel Urban added the comment: It doesn't work with staticmethod: >>> import abc >>> >>> class C(metaclass=abc.ABCMeta): ... @staticmethod ... @abc.abstractmethod ... def foo(x): ... raise NotImplementedError() ... >>> clas

[issue11610] Improved support for abstract base classes with descriptors

2011-06-20 Thread Daniel Urban
Daniel Urban added the comment: I've posted some comments on Rietveld. -- ___ Python tracker <http://bugs.python.org/issue11610> ___ ___ Python-bugs-list m

[issue12374] Execution model should explain compile vs definition vs execution time

2011-06-24 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12374> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12459] time.sleep(-1.0) behaviour

2011-07-01 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12459> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12457] type() returns incorrect type for nested classes

2011-07-01 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12457> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue8639] Allow callable objects in inspect.getargspec

2011-07-09 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue8639> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12559] gzip.open() needs an optional encoding argument

2011-07-14 Thread Daniel Urban
Daniel Urban added the comment: Here is a patch. If the code changes are acceptable I can also make a documentation patch. (I'm surprised to see 3.2 in "Versions". I thought 3.2 only gets bugfixes...) -- keywords: +patch nosy: +durban Added file: http://bugs.pytho

[issue12559] gzip.open() needs an optional encoding argument

2011-07-15 Thread Daniel Urban
Daniel Urban added the comment: > If we go this way, the "errors" and "newline" argument should be added > as well. Yeah, I thought about that. I can make a new patch, that implement this, if needed. Though it seems there is a real problem, the one that Amaury F

[issue12575] add a AST validator

2011-07-16 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12575> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12608] crash in PyAST_Compile when running Python code

2011-07-22 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12608> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12599] Use 'is not None' where appropriate in importlib

2011-07-22 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12599> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12617] Mutable Sequence Type can work not only with iterable in slice[i:j] = t

2011-07-23 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12617> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12647] Add __bool__ to None

2011-07-28 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12647> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12657] Cannot override JSON encoding of basic type subclasses

2011-07-30 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12657> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12691] tokenize.untokenize is broken

2011-08-05 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12691> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12675] tokenize module happily tokenizes code with syntax errors

2011-08-05 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12675> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12735] request full Unicode collation support in std python library

2011-08-12 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12735> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12732] Can't portably use Unicode in Python identifiers

2011-08-12 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12732> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12772] fractional day attribute in datetime class

2011-08-18 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban versions: +Python 3.3 -Python 2.7 ___ Python tracker <http://bugs.python.org/issue12772> ___ ___ Python-bugs-list mailin

[issue12775] immense performance problems related to the garbage collector

2011-08-18 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12775> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12857] Expose called function on frame object

2011-08-30 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12857> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12850] [PATCH] stm.atomic

2011-08-30 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12850> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12915] Add inspect.locate and inspect.resolve

2011-09-09 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue12915> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5867] No way to create an abstract classmethod

2010-08-12 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue5867> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5996] abstract class instantiable when subclassing dict

2010-08-12 Thread Daniel Urban
Daniel Urban added the comment: I think, that the reason is that, object.__new__ checks, if the class is instantiable (object_new in Objects/typeobject.c ). dict.__new__ (and tuple.__new__, and I guess the __new__ method of other built-in types) doesn't call object.__new__, but user de

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban
Daniel Urban added the comment: @abstractmethod @classmethod def ... doesn't work because classmethod objects doesn't have a __dict__, so setting arbitrary attributes don't work, and abstractmethod tries to set the __isabstractmethod__ atribute to True. The other orde

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban
Daniel Urban added the comment: Here is a patch, which adds a descriptor to classmethod and staticmethod. Pseudocode: __get__(self, inst, owner): if getattr(inst.callable, '__isabstractmethod__', False): return True return False __set__(self, inst, value): ins

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban
Daniel Urban added the comment: If I understand correctly, some tests are needed for the instantiation of classes with abstract static/classmethods. I added them in issue5867a.diff. -- Added file: http://bugs.python.org/file18512/issue5867a.diff

[issue5867] No way to create an abstract classmethod

2010-08-14 Thread Daniel Urban
Daniel Urban added the comment: I'm attaching a new patch adding the abc.abstractclassmethod and abc.abstractstaticmethod decorators. -- Added file: http://bugs.python.org/file18519/abstractclassstaticmethod.diff ___ Python tracker

[issue5867] No way to create an abstract classmethod

2010-08-16 Thread Daniel Urban
Daniel Urban added the comment: I'm attaching a new patch containing also some documentation for the two new decorators. The doc is rather terse, and english is not my first language, so please let me know if some corrections are needed. -- Added file: http://bugs.pytho

[issue1615] descriptor protocol bug

2010-08-16 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue1615> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9212] dict_keys purports to implement the Set ABC, but is missing the isdisjoint method

2010-09-01 Thread Daniel Urban
Daniel Urban added the comment: Thanks for the corrections. I'm attaching the new patch as issue9212b.diff. I'm using PyAnySet_Check to determine if the other argument is really a set, but I'm not entirely sure, that this is correct. Please let me know if other correct

[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-04 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue9731> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9213] range purports to implement the Sequence ABC, but is missing index and count methods

2010-09-10 Thread Daniel Urban
Daniel Urban added the comment: > Attached is a greatly revised patch, with two significant changes: > - Adds support for !PyLong_CheckExact (using _PySequence_IterSearch) Thanks, indeed, we should support that. > Any strong feelings on whether range.index should support the start a

[issue8699] Equality and hashing for functools.partial

2010-09-10 Thread Daniel Urban
Daniel Urban added the comment: Is there anybody, who is interested in this? There are some substantial problems with it (hashing a dict), so I suggest that this should be closed, unless somebody is interested. -- status: open -> pending ___ Pyt

[issue4761] create Python wrappers for openat() and others

2010-09-15 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue4761> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9746] All sequence types support .index and .count

2010-09-15 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue9746> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9756] Crash with custom __getattribute__

2010-09-15 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue9756> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9896] Introspectable range objects

2010-09-18 Thread Daniel Urban
New submission from Daniel Urban : The attached patch adds the start, stop and step members to range objects, corresponding the contructor arguments. The patch also include tests and documentation changes. -- components: Interpreter Core files: range_attrs.diff keywords: patch

[issue9896] Introspectable range objects

2010-09-19 Thread Daniel Urban
Daniel Urban added the comment: > What is the use case for this? The basic idea was, that in Python almost everything is introspectable, so why range objects aren't. It was pretty straightforward to implement it, so I've done it (actually when I was working on rangeobject.c, I

[issue9971] Optimize BufferedReader.readinto

2010-09-29 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue9971> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9533] metaclass can't derive from ABC

2010-10-01 Thread Daniel Urban
Daniel Urban added the comment: If we create a new class, which is a metaclass, and also inherits an ABC, we create a new instance of ABCMeta. When ABCMeta.__new__ creates the __abstractmethods__ attribute of the new class, it iterates over the __abstractmethods__ attribute of every base

[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue10006> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue10049> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10224] Build 3.x documentation using python3.x

2010-10-29 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue10224> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11297] Make ChainMap() public in the collections module.

2011-02-23 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11297> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11333] Add empty __slots__ to collections.abc abstract base classes

2011-02-26 Thread Daniel Urban
New submission from Daniel Urban : Currently instances of classes which inherit an ABC in collections.abc will have a __dict__. This can be a problem for example a tree-like data structure. It would make sense to inherit for example MutableMapping, but that would possibly mean, that every

[issue10868] ABCMeta.register() should work as a decorator

2011-02-26 Thread Daniel Urban
Daniel Urban added the comment: > In what use-cases would you want to call MyABC.register() when defining > a class instead of inheriting from MyABC? For example if you don't want to inherit a __dict__ for a tree-like data structure (see also

[issue11256] inspect.getcallargs raises TypeError on valid arguments

2011-02-26 Thread Daniel Urban
Daniel Urban added the comment: Updated patch with extra tests. -- Added file: http://bugs.python.org/file20911/issue11256_2.diff ___ Python tracker <http://bugs.python.org/issue11

[issue11256] inspect.getcallargs raises TypeError on valid arguments

2011-02-27 Thread Daniel Urban
Daniel Urban added the comment: I found another case, when this is a problem: if there are no **kwargs, but there are some keyword-only arguments: >>> def f(*, a, b): pass ... >>> f(a=1, b=2) >>> >>> getcallargs(f, a=1, b=2) Traceback (most recent call la

[issue11339] annotation for class being defined

2011-02-27 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11339> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9276] pickle should support methods

2011-03-01 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue9276> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11378] os.path.join when second argument starts with '/' (linux/unix)

2011-03-02 Thread Daniel Urban
Daniel Urban added the comment: It does exactly what is documented: "If any component is an absolute path, all previous components (on Windows, including the previous drive letter, if there was one) are thrown away, and joining continues." (http://docs.python.org/dev/py3k/libra

[issue11388] Implement MutableSequence.clear()

2011-03-03 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11388> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2011-03-06 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue4806> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7689] Pickling of classes with a metaclass and copy_reg

2011-03-06 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue7689> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2011-03-06 Thread Daniel Urban
Daniel Urban added the comment: I think the patch isn't entirely correct. It uses PyIter_Check for detecting the case when an *iterable* raises TypeError, but that function actually checks for an *iterator*. The check on the tp_iter member mentioned by Amaury Forgeot d'Arc prob

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2011-03-06 Thread Daniel Urban
Daniel Urban added the comment: I'm attaching an updated patch. Instead !PyIter_Check() this patch checks for tp_iter == NULL && !PySequence_Check. If this condition is false, PyObject_GetIter has a chance to succeed (and if it fails, we shouldn't mask the exception).

[issue11441] compile() raises SystemError if called from except clause

2011-03-08 Thread Daniel Urban
Daniel Urban added the comment: Apparently ast_error_finish calls PyTuple_GetItem with a value that is not a tuple, but a SyntaxError instance (in Python/ast.c line 112). It seems that ast_error_finish expects that PyErr_Fetch will return the exception value as a tuple, and in some cases

[issue11441] compile() raises SystemError if called from except clause

2011-03-08 Thread Daniel Urban
Daniel Urban added the comment: Here is a patch. I wasn't sure, where to put the test, so I put it in test_ast. -- keywords: +patch Added file: http://bugs.python.org/file21054/issue11441.patch ___ Python tracker <http://bugs.python.org/is

[issue11441] compile() raises SystemError if called from except clause

2011-03-08 Thread Daniel Urban
Daniel Urban added the comment: Okay, here is a new patch with the test in the correct place (I hope). -- Added file: http://bugs.python.org/file21055/issue11441_2.patch ___ Python tracker <http://bugs.python.org/issue11

[issue11441] compile() raises SystemError if called from except clause

2011-03-08 Thread Daniel Urban
Daniel Urban added the comment: > Why is the exception normalized at the end? I suppose it's because > when value is an exception instance, it's replaced by a tuple, but the > original value has to be recreated at the end. So in some cases, the > SyntaxError object is c

[issue11441] compile() raises SystemError if called from except clause

2011-03-09 Thread Daniel Urban
Daniel Urban added the comment: > You could also call PyErr_NormalizeException at the beginning, and > update the fields directly in the PySyntaxErrorObject structure. No > need to deal with any tuple. Sorry, but I don't really understand. If I call PyErr_NormalizeException at

[issue11441] compile() raises SystemError if called from except clause

2011-03-10 Thread Daniel Urban
Daniel Urban added the comment: So, I see four possible solutions: 1. If we get a tuple, create the new tuple, normalize the exception, and store it. If we get a SyntaxError instance, use its args, create the new tuple, normalize, and store. (In this case a SyntaxError instance will be

[issue11441] compile() raises SystemError if called from except clause

2011-03-10 Thread Daniel Urban
Daniel Urban added the comment: Err... sorry, I don't understand again: If we get a tuple, create a new, store it without normalization. That's okay, I understand. If we get a SyntaxError instance, then take its args field, create the new tuple. Then call PyErr_NormalizeException(

[issue11455] issue a warning when populating a CPython type dict with non-string keys

2011-03-10 Thread Daniel Urban
Daniel Urban added the comment: > Can somebody propose a patch? Yes, here it is. (I'm not sure if the test is in the correct file.) -- keywords: +patch nosy: +durban Added file: http://bugs.python.org/file21072/issue11455.patch ___ Python

[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11470> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11477] Bug in code dispatching based on internal slots

2011-03-13 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11477> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11480] Cannot copy a class with a metaclass other than type

2011-03-13 Thread Daniel Urban
New submission from Daniel Urban : copy.copy cannot copy a class which have a metaclass other than type: >>> import abc >>> import copy >>> >>> class C(metaclass=abc.ABCMeta): ... pass ... >>> copy.copy(C) Traceback (most recent call last)

[issue11481] The copy module already uses copyreg

2011-03-13 Thread Daniel Urban
New submission from Daniel Urban : In the copyreg documentation there is this sentence: "The copy module is likely to use this in the future as well." (http://docs.python.org/dev/py3k/library/copyreg) But the copy module already uses the copyreg module. -- assignee: d

[issue7689] Pickling of classes with a metaclass and copy_reg

2011-03-13 Thread Daniel Urban
Daniel Urban added the comment: Attaching an updated patch for py3k. > Not an expert, but the Python parts of your patch look good to me. Me neither, but the C parts also look good to me. The tests fail without the patch, succeed with it. Note, that it is possible, that the copy module a

[issue11549] Rewrite peephole to work on AST

2011-03-15 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11549> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11133] inspect.getattr_static code execution

2011-03-16 Thread Daniel Urban
Daniel Urban added the comment: The new entry in Misc/NEWS says: "Patch by Daniel Urban." But it wasn't me, who made the patch, I just opened the issue. -- ___ Python tracker <http://bugs.pyt

[issue11562] += on list inside a tuple raises TypeError but succeds anyway

2011-03-16 Thread Daniel Urban
Daniel Urban added the comment: The reason of this behaviour is that x += 1 basically is the same as x = x.__iadd__(1). In the tuple case: t[1] = t[1].__iadd__([6]). The __iadd__ call mutates the list, then the tuple item assignment raises the TypeError. See these examples: >>&g

[issue11572] bring Lib/copy.py to 100% coverage

2011-03-18 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11572> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11256] inspect.getcallargs raises TypeError on valid arguments

2011-03-18 Thread Daniel Urban
Daniel Urban added the comment: Updated the patch for mercurial. -- Added file: http://bugs.python.org/file21281/issue11256_4.patch ___ Python tracker <http://bugs.python.org/issue11

[issue11610] Improving property to accept abstract methods

2011-03-19 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11610> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11610] Improving property to accept abstract methods

2011-03-19 Thread Daniel Urban
Daniel Urban added the comment: I looked at the patch (I didn't test it yet), my comments are on Rietveld. -- ___ Python tracker <http://bugs.python.org/is

[issue11610] Improving property to accept abstract methods

2011-03-20 Thread Daniel Urban
Daniel Urban added the comment: I tried to test your patch, but the build dies with this error: Fatal Python error: Py_Initialize: can't initialize sys standard streams Traceback (most recent call last): File ".../cpython/Lib/io.py", line 60, in Aborted I don't know wh

[issue7913] Enhance Cmd support for docstrings and document it.

2011-03-20 Thread Daniel Urban
Daniel Urban added the comment: inspect.cleandoc (which is also used by inspect.getdoc and pydoc.getdoc) seems to do a similar thing. Maybe that could be used for this? -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue7

[issue10977] Concrete object C API needs abstract path for subclasses of builtin types

2011-03-20 Thread Daniel Urban
Daniel Urban added the comment: Here is a patch for list. It modifies the following C API functions: PyList_SetItem PyList_Insert PyList_Append PyList_SetSlice PyList_Sort PyList_Reverse _PyList_Extend It also includes tests (with ctypes). I plan to do next the same for dict, but first I&#

[issue11455] issue a warning when populating a CPython type dict with non-string keys

2011-03-24 Thread Daniel Urban
Daniel Urban added the comment: > I would prefer an explicit PyExc_RuntimeWarning to not have to read the > source of PyErr_WarnFormat() or its documentation. The patch at issue11470 adds a new warning type, CompatibilityWarning. I think probably that should be used he

[issue11660] closure with too few cells segfaults

2011-03-24 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11660> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11664] Add patch method to unittest.TestCase

2011-03-25 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11664> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11640] Shelve references globals in its __del__ method

2011-03-25 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11640> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5135] Expose simplegeneric function in functools module

2011-03-26 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue5135> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11680] decimal module generates AttributeError: on call to as_integer_ratio

2011-03-26 Thread Daniel Urban
Daniel Urban added the comment: The problem seems to be that you're calling Decimal.from_float with a Decimal instance, not a float. I'm not sure that should even work. The Decimal constructor can create a decimal from an other decimal. Your suggested solution probably would

[issue887237] Machine integers

2011-03-27 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue887237> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11549] Rewrite peephole to work on AST

2011-03-27 Thread Daniel Urban
Daniel Urban added the comment: > not x == 2 can be theoretically optimized to x != 2, ... I don't think it can: >>> class X: ... def __eq__(self, other): ... return True ... def __ne__(self, other): ... return True ... >>> x = X()

[issue7796] No way to find out if an object is an instance of a namedtuple

2011-03-28 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue7796> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11707] Create C version of functools.cmp_to_key()

2011-04-01 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11707> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1294232] Error in metaclass search order

2011-04-03 Thread Daniel Urban
Daniel Urban added the comment: The attached test case currently fails. I'll try to make a patch soon. > Perhaps __build_class__ (which I have not read) should either call > type_new or a new function with the winner calculation factored out of > type_new. Yeah, that'

[issue11759] assert for exception parameters

2011-04-04 Thread Daniel Urban
Daniel Urban added the comment: What about this: >>> class MyTestCase(TestCase): ... def test_foo(self): ... with self.assertRaises(SyntaxError) as cm: ... compile('asdf jkl', 'file.py', 'eval') ..

[issue1294232] Error in metaclass search order

2011-04-04 Thread Daniel Urban
Daniel Urban added the comment: The attached patch seems to correct this issue. It contains the test attached yesterday, and it passes now. I factored out the winner calculation from type_new to a new _PyType_CalculateWinner function, and type_new calls this. I've put the declarati

[issue11764] inspect.getattr_static code execution w/ class body as non dict

2011-04-08 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue11764> ___ ___ Python-bugs-list mailing list Unsubscribe:

  1   2   3   >