Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11770>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11796>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11823>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Daniel Urban :
slice.indices behaves strangely with negative step and default stop values
(note that the doc says that it "computes information about the slice that the
slice object would describe if applied to a sequence of length items"):
>>> s = s
Daniel Urban added the comment:
I see. Thanks for the explanation. If indeed this is the expected behaviour (as
it seems), then I suggest clarifying the documentation. I think it would be
good to mention that the returned values are for range(), and not for creating
another slice object
New submission from Daniel Urban :
The attached crash.py script reliably crashes the 3.2 and 3.3 interpreter on my
machine. The script does a lot of range slicing.
I think there is a typo in compute_slice_indices() in rangeobject.c, in line
475. In line 474 there is an assign to tmp_stop, and
Daniel Urban added the comment:
Now that the moratorium has already ended, I'll try again. I've updated the
patch.
It seems, that this idea has already came up in the past: Guido in msg70525
said: "I also think ranges should be introspectable, exposing their start, stop
Daniel Urban added the comment:
Thanks for the review!
I've updated my patch:
- renamed it to _PyType_CalculateMetaclass
- in __build_class__ call it even when a metaclass is declared
- added a test for this case (which fails with my previous patch)
However I noticed another problem
Daniel Urban added the comment:
Thanks, I've corrected my patch.
--
Added file: http://bugs.python.org/file21733/range_attrs_3.patch
___
Python tracker
<http://bugs.python.org/i
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11875>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
That may be, but with my latest patch, this works (func is a function):
class X(metaclass=func):
pass
But this blows up with a TypeError:
class X(object, metaclass=func):
pass
Is this the desired behaviour? Or should we disallow non-class metaclasses
Daniel Urban added the comment:
I'm attaching the updated patch. Changes:
- Special casing objects we can't do the metaclass computation for.
- Tests for these.
- Adding tests for the order of __new__ calls.
The special case isn't just checking if the object is a class, but in
Daniel Urban added the comment:
I've just realized, that my patch still breaks a case, that previously worked:
when the bases are not classes.
This works in 3.2, but not with my patch:
>>> class Foo: # not a subclass of type!
... def __new__(mcls, name='foo
Daniel Urban added the comment:
Okay, probably the check in my previous patch was too strict (sorry for the
noise). I'm attaching an updated patch again. Now the algorithm in
__build_class__ is this:
1. If an object is explicitly given with the metaclass keyword, that is the
&quo
Changes by Daniel Urban :
Removed file: http://bugs.python.org/file21755/issue11256_4.patch
___
Python tracker
<http://bugs.python.org/issue1294232>
___
___
Python-bug
Changes by Daniel Urban :
Added file: http://bugs.python.org/file21756/issue_1294232_4.patch
___
Python tracker
<http://bugs.python.org/issue1294232>
___
___
Python-bug
Daniel Urban added the comment:
This may be the same/similar as issue4806 (which has a patch).
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11924>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11945>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11949>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11762>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11967>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue12022>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue12029>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue1748064>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue12077>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue10271>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue12128>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
Here is a patch. It includes tests.
--
keywords: +patch
nosy: +durban
Added file: http://bugs.python.org/file19637/issue4113.diff
___
Python tracker
<http://bugs.python.org/issue4
Daniel Urban added the comment:
Well, of course it can be done with PyUnicode_Concat (obviously, since
PyUnicode_AppendAndDel uses that). I used PyUnicode_AppendAndDel because that
function does exactly what I needed.
I don't see why PyUnicode_AppendAndDel should be deprecated. Anyway,
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue10474>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue10518>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Daniel Urban :
If the type of x defines __next__, but not __iter__, isinstance(x,
collections.Iterator) returns True, but in fact x isn't iterable.
>>> class X:
... def __next__(self):
... raise StopIteration()
...
>>> x
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue8743>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue10589>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Daniel Urban :
But "Defining a Stable ABI" is PEP 384: http://www.python.org/dev/peps/pep-0384/
(PEP 382 is "Namespace Packages")
--
assignee: d...@python
components: Documentation
messages: 123345
nosy: d...@python, durban
priority: normal
sev
Daniel Urban added the comment:
> What also worries me is the difference between the "class"
> statement and the type() function.
I think the reason of this is that the class statement uses the __build_class__
builtin function. This function determines the metaclass to use
Daniel Urban added the comment:
Based on David Stanek's patch I've made a patch against the current py3k
branch. The only difference is, that dict_proxy.__repr__ instead of simply
returning the repr of the dict, returns approximately
"dict_proxy({!r})".format(self.dic
Daniel Urban added the comment:
> Thanks for the patch! Can you include also a test that verifies
> that the repr is printed correctly?
Sure. Where should I put the test? I didn't found any dict_proxy tests, except
in test_descr.py ("# Classes don't allow __dict__ assignm
New submission from Daniel Urban :
The keys, values and items methods of dict_proxy return a list, while
dict.keys, etc. return dictionary views (dict_keys, etc.). dict_proxy is used
as the __dict__ attribute of classes. This is documented at
http://docs.python.org/dev/py3k/reference
Daniel Urban added the comment:
Okay, I found it :-) Here is a new patch, now with a test.
--
Added file: http://bugs.python.org/file19966/issue5587b.diff
___
Python tracker
<http://bugs.python.org/issue5
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue10667>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
It probably also works if | is used instead of +, because in 3.2
dict_proxy.keys() are a dict_keys, not a list. See issue10630 .
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue10
Daniel Urban added the comment:
I don't think, that this is in an example (but probably there is an example
somewhere, that crashes because of this). I found the code in
Lib/tkinter/scrolledtext.py
--
___
Python tracker
<http://bugs.py
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue7436>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
There is another return statement earlier in the ABCMeta.register method. The
patch probably should also modify that.
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue10
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue10775>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Daniel Urban :
In http://docs.python.org/dev/py3k/whatsnew/3.2.html#abc the example has two
typos:
farenheit -> fahrenheit
celsium -> celsius
--
assignee: docs@python
components: Documentation
messages: 126938
nosy: docs@python, durban
priority: normal
se
Daniel Urban added the comment:
It seems, that this possible problem already came up when __build_class__ got
implemented, see issue1681101. The second and third version of the patch at
this issue (file7874 and file7875) contains a comment: "XXX Should we do the
"winner" c
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue10977>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
I cannot reproduce this with the current py3k branch (Ubuntu 10.04 32 bit).
--
nosy: +durban
type: -> crash
___
Python tracker
<http://bugs.python.org/issu
Daniel Urban added the comment:
Thanks for the instructions. You're right, this way I can reproduce the
segfault.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11085>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
In the abc.abstractclassmethod
example(http://docs.python.org/dev/py3k/whatsnew/3.2.html#abc), the methods
probably should use cls as the name of the first parameter, not self, because
they are classmethods.
--
nosy: +durban
Daniel Urban added the comment:
In the shutil example
(http://docs.python.org/dev/py3k/whatsnew/3.2.html#shutil) the function
argument of shutil.register_archive_format is a string, but according to
http://docs.python.org/dev/py3k/library/shutil.html#shutil.register_archive_format
it should
New submission from Daniel Urban :
The documentation of getattr_static says:
"The only known case that can cause getattr_static to trigger code execution,
and cause it to return incorrect results (or even break), is where a class uses
__slots__ and provides a __dict__ member using a pro
New submission from Daniel Urban :
The example in the shelve documentation
(http://docs.python.org/dev/py3k/library/shelve.html#example) uses the old
range() (which returned a list):
d['xx'] = range(4) # this works as expected, but...
d['xx'].append(5) # *this doesn
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue11248>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Daniel Urban :
inspect.getcallargs raises TypeError if given a function with only **kwargs,
and some keyword arguments:
Python 3.3a0 (py3k:88451, Feb 20 2011, 12:37:22)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or
Daniel Urban added the comment:
Here is a patch. It also includes tests that would have detected this bug. It
also corrects a case when getcallargs raised an exception with a different
message (there are tests also for this):
>>> def f(**kwargs): pass
...
>>> f(1, a=
Daniel Urban added the comment:
I've made a patch, which adds a disassemble_str function to the dis module. The
dis.dis function calls this function if x is a string. Added the following
sentence to the documentation: "Strings are first compiled to code objects with
the :func:`comp
Daniel Urban added the comment:
I've made a patch.
This patch adds a datetime_rfcformat function to datetimemodule.c which is
available from Python as the datetime.rfcformat method in the datetime module.
This method returns the date in RFC 3339 format:
-MM-DDTHH:MM:SS[.mm]+
Daniel Urban added the comment:
Any chance, that my patch will be accepted? Is there a problem with it?
Thanks.
--
___
Python tracker
<http://bugs.python.org/issue6
Daniel Urban added the comment:
Is anyone still interested in this? Is there a problem with my patch?
Thanks.
--
___
Python tracker
<http://bugs.python.org/issue7
Daniel Urban added the comment:
> My Python code as well as your patch doesn't specify that "Z" must be
> present when time zone offset is unknown or absent,
Yes, that is because RFC 3339 explicitly says (in 4.3.) that -00:00 is "differs
semantically from an offset
Daniel Urban added the comment:
> I do not think that -00:00 or +00:00 will be invalid Atom timestamp,
> but to implement parser of rfc3339 timestamp, Z handling is still
> needed. I can easily imagine people making wrong assumption that
> parsing 00:00 at the end would be enoug
Daniel Urban added the comment:
> The point is that your implementation doesn't allow people to generate
> 'Z'-ending timestamp if they need a subset of rfc3339.
That is exactly right. Do you have any suggestion, how to do that? Maybe an
optional argument to the rfcfor
New submission from Daniel Urban :
The current documentation of the imag abstract property of numbers.Complex is
this:
"Abstract. Retrieves the Real component of this number."
Of course the imag attribute is the imaginary component, not the real.
--
assignee: d...@python
New submission from Daniel Urban :
There is a sentence in the weakref module's documentation:
"Other built-in types such as tuple and long do not support weak references
even when subclassed"
But there is no "long" type in py3k.
--
assignee: d...@python
Daniel Urban added the comment:
Done. Attached new patch as issue6507_2_priv.diff.
--
Added file: http://bugs.python.org/file17265/issue6507_2_priv.diff
___
Python tracker
<http://bugs.python.org/issue6
Daniel Urban added the comment:
Attached a patch. It changes the docstring to:
"enumerate(iterable[, start]) -> iterator for index, value of iterable
Return an enumerate object. iterable must be another object that supports
iteration, start must be an integer (defaults to 0). The e
Daniel Urban added the comment:
Here is a new patch.
The name of the optional argument is "default_utcoffset" which is obviously too
long, but I can't think a better name. Any suggestions? (I think simply
"utcoffset" would be misleading, because the value of the a
New submission from Daniel Urban :
In the documentation of the exceptions
(http://docs.python.org/dev/py3k/library/exceptions) there is a sentence:
"The associated value is the second argument to the raise statement."
But in py3k there is a different raise statement t
New submission from Daniel Urban :
On python-dev came up an idea [1] to support equality (== and !=) and hashing
by functools.partial instances. Van Lindberg provided an implementation
written in Python [2]. I've made a very similar implementation in C (in
Modules/_functoolsmodule.c).
Daniel Urban added the comment:
Sorry, I realized I made a stupid mistake. (I didn't use PyList_Sort to sort
the list in partial_hash.)
Here is the corrected patch.
--
Added file: http://bugs.python.org/file17315/partial_eq_hash_2.diff
___
P
New submission from Daniel Urban :
The Py3k documentation of PyList_Type [1] contains the sentence:
"This is the same object as list and types.ListType in the Python layer."
But there is no types.ListType object in py3k.
[1] http://docs.python.org/dev/py3k/c-api/list.html#P
Daniel Urban added the comment:
On python-dev Yaniv Aknin pointed out that the keywords dictionary of a partial
object is mutable [1]. This causes problems with hashing and equality. The
new patch replaces the keywords dictionary with a read-only proxy of that
dictionary. This seems to
Daniel Urban added the comment:
@habnabit I believe I've already signed some contributor form some years ago.
If there is a new one, I can sign that one too.
--
___
Python tracker
<https://bugs.python.org/is
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue14051>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Daniel Urban :
As Nick Coghlan proposed [1, 2], there should be a way to dynamically create
classes, which handles metaclasses correctly (see also issue1294232).
Here is my first attempt at creating an operator.build_class method. It only
includes very simple tests and no
Daniel Urban added the comment:
I've attached a patch with more tests. I simply copied and modified the tests
about metaclass calculation and __prepare__ in test_descr.py, to create the
tested classes with operator.build_class (and not the class statement).
Although, there is one thin
Daniel Urban added the comment:
Fair enough.
--
___
Python tracker
<http://bugs.python.org/issue14588>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
I've attached the third patch with the eval_body -> exec_body change;
explicitly passing the default (None) now also allowed. I also fixed a refleak
(I think).
--
Added file: http://bugs.python.org/file25292/operator_build_class
Daniel Urban added the comment:
I've attached a patch implementing inspect.unwrap (+ some tests).
--
keywords: +patch
Added file: http://bugs.python.org/file25368/inspect_unwrap.patch
___
Python tracker
<http://bugs.python.org/is
Daniel Urban added the comment:
Here is my first attempt at creating a pure Python version of the
operator.build_class function (in my previous patch) as types.new_class.
The three added functions (two private and one public) correspond to the
following functions in my previous patch
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue14857>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Daniel Urban :
--
nosy: +durban
___
Python tracker
<http://bugs.python.org/issue12370>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
I've updated the patch to the current version. I've also checked, that the
tests still pass.
--
nosy: +ncoghlan
Added file: http://bugs.python.org/file25806/copy_metaclass_2.patch
___
Python trac
Daniel Urban added the comment:
I'm attaching a patch implementing super.__setattr__ (and __delattr__).
The implementation in the patch only works, if super can find a data descriptor
in the MRO, otherwise it throws an AttributeError. As it can be seen in the
tests, in some cases thi
Changes by Daniel Urban :
--
components: +Extension Modules -Library (Lib)
___
Python tracker
<http://bugs.python.org/issue14965>
___
___
Python-bugs-list mailin
Changes by Daniel Urban :
--
nosy: +daniel.urban
___
Python tracker
<http://bugs.python.org/issue15243>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
eval(repr(float('nan'))) doesn't work either, so I'm not sure ast.literal_eval
should. The same with float('inf').
--
nosy: +daniel.urban
___
Python tracker
<
Daniel Urban added the comment:
__prepare__ is not implicitly a staticmethod, and it is called exactly as
documented (also in types.prepare_class). There is no implicit first argument
because the method is called on the (meta)class object
Daniel Urban added the comment:
Actually the docs contained a similar sentence ("If the metaclass has a
:meth:`__prepare__` attribute (usually implemented as a class or static
method), ..."), but it was removed in befd56673c80 when Nick rewrote thi
Changes by Daniel Urban :
--
nosy: +daniel.urban
___
Python tracker
<http://bugs.python.org/issue15397>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
I've attached a patch addressing the comments on Rietveld. I've added another
modification: inspect.signature uses inspect.unwrap. (It already tried to
unwrap the function, but it wasn't protected from infinite recursion. I don't
know if
Changes by Daniel Urban :
--
nosy: +daniel.urban
___
Python tracker
<http://bugs.python.org/issue14631>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Urban added the comment:
I've added some tests and documentation. English is not my first language, so
the docs almost certainly need some correction.
--
nosy: +daniel.urban
Added file: http://bugs.python.org/file28066/doctest_fail_fast_2.
Changes by Daniel Urban :
Removed file: http://bugs.python.org/file28066/doctest_fail_fast_2.patch
___
Python tracker
<http://bugs.python.org/issue16522>
___
___
Pytho
Daniel Urban added the comment:
I'm sorry, I forgot the versionadded directive. The fixed patch is attached.
--
Added file: http://bugs.python.org/file28067/doctest_fail_fast_3.patch
___
Python tracker
<http://bugs.python.org/is
101 - 200 of 271 matches
Mail list logo