Daniel Stutzbach added the comment:
Yes, I'm sure. See below.
Also, the 2.6 docs mention it as being new in 2.6:
http://docs.python.org/library/tempfile.html
Cashew:~$ python2.6
Python 2.6.2 (r262:71600, Apr 15 2009, 07:20:39)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125
Daniel Stutzbach added the comment:
C:\>c:\python26\python
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>
Daniel Stutzbach added the comment:
Oy vey. That's what I get for not reading carefully. And in my
original example it seems I had a python 2.5 install wandering around in
my path. My apologies.
--
status: open -> closed
___
Python tracke
Daniel Stutzbach added the comment:
Attached is an updated patch.
In addition to the code cleanup and bug fix suggestions, it includes a new
base-case for factorial_partial_product. Instead of:
if (n >= m)
return n
if (n + 2 == m)
return n*m
otherwise divide-and-conquer
It now d
Changes by Daniel Stutzbach :
Removed file: http://bugs.python.org/file17338/factorial.patch
___
Python tracker
<http://bugs.python.org/issue8692>
___
___
Python-bug
Daniel Stutzbach added the comment:
I made a few minor updates to the patch.
It redefines partial_product to product(range(n, m, 2)), which saved me a few
operations and is more Pythonic than what I had before. :-)
(Not quite what Alexander was after, but it's a step in the right dire
Daniel Stutzbach added the comment:
On Fri, May 14, 2010 at 3:25 PM, Mark Dickinson wrote:
> The patch looks good. Just one issue: I think the overflow check for
> num_operands * last_bit is bogus. It's possible for the product to overflow
> and still end up being less tha
Daniel Stutzbach added the comment:
Looks good.
--
___
Python tracker
<http://bugs.python.org/issue8692>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Stutzbach added the comment:
The comment for bit_length is missing a space or two:
"Objects/longobject.c.Someday"
--
___
Python tracker
<http://bugs.python.
New submission from Daniel Stutzbach :
The Mapping ABC's __eq__ method should return NotImplemented if the other type
is not a Mapping, to give the other type a chance at the comparison. Right now
it simply returns false.
The comparison methods on the other ABCs in _abcoll.py already r
Daniel Stutzbach added the comment:
Will do, sometime this week.
--
___
Python tracker
<http://bugs.python.org/issue8729>
___
___
Python-bugs-list mailin
Changes by Daniel Stutzbach :
--
assignee: stutzbach
components: Documentation
keywords: easy
nosy: stutzbach
priority: normal
severity: normal
stage: needs patch
status: open
title: *= is undocumented for lists
versions: Python 2.7, Python 3.2
Daniel Stutzbach added the comment:
Good point, since I see now that *= (and +=) also works on immutable sequence
types (though does something subtly different). I always forget that.
--
resolution: -> invalid
stage: needs patch -> committed/rejected
status: open -&g
New submission from Daniel Stutzbach :
The set() operators (__or__, __and__, __sub__, __xor__, and their in-place
counterparts) require that the parameter also be an instance of set().
They're documented that way: "This precludes error-prone constructions like
set('abc')
Daniel Stutzbach added the comment:
I should add:
I discovered the inconsistency while working on my sortedset class, which
provides the same interface as set() but is also indexable like a list (e.g.,
S[0] always returns the minimum element, S[-1] returns the maximum element,
etc
Daniel Stutzbach added the comment:
Antoine, do you have a suggestion for someone with with better knowledge of
ABCs to do the final review, so that I may very politely pester them? ;-)
--
___
Python tracker
<http://bugs.python.org/issue2
Daniel Stutzbach added the comment:
Is there anything more I can do to help get this crash-fix committed before 2.7
rc1?
--
___
Python tracker
<http://bugs.python.org/issue7
New submission from Daniel Stutzbach :
For example, here is one of MutableSet's methods:
def __isub__(self, it):
for value in it:
self.discard(value)
return self
However, if I do "x -= x", then it mutates my set-like object during iteration,
New submission from Daniel Stutzbach :
For operations that test membership in a set, Python coerces sets and
subclasses of set into a temporary frozenset before testing membership.
For example, this works:
>>> set() in set([frozenset()])
True
Although the set() is not hashable itsel
Changes by Daniel Stutzbach :
--
assignee: stutzbach
components: Documentation
nosy: stutzbach
priority: normal
severity: normal
stage: needs patch
status: open
title: Py_ReprEnter and Py_ReprLeave are undocumented
versions: Python 2.7, Python 3.2
New submission from Daniel Stutzbach :
"some_set in some_set_of_sets" contains a race condition that can lead to odd
behavior. To perform the test, the set_contains() function in setobject.c
creates a temporary frozenset object (t), swaps the bodies of some_set and t,
checks
Daniel Stutzbach added the comment:
Here's a patch that adds test cases. It exercises all of the following special
methods on Set and Mapping to ensure that they return NotImplemented if they
don't recognize the other type.
lt, gt, le, ge, eq, ne, or, and, xor, sub
I made
New submission from Daniel Stutzbach :
In test_set.py (and test_sets.py in 2.x), there's a method named
"checkempty_symmetric_difference". It should be named
"test_checkempty_symmetric_difference" so that it will actually be called as a
test. It's not refer
Daniel Stutzbach added the comment:
Done: http://codereview.appspot.com/1193044
This is my first time using Rietveld. Let me know if I've done anything wrong.
--
___
Python tracker
<http://bugs.python.org/i
Changes by Daniel Stutzbach :
--
nosy: -agthorr
___
Python tracker
<http://bugs.python.org/issue1289118>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Daniel Stutzbach :
If ./configure detects that the system's wchar_t type is compatible, it will
define "#define PY_UNICODE_TYPE wchar_t" and enable certain optimizations when
converting between Py_UNICODE and wchar_t (i.e., it can just do a memcpy).
Right n
Daniel Stutzbach added the comment:
Usually you wouldn't want to cast a char directly to a Py_UNICODE, because you
need to take into account the encoding of the char and map it to the
appropriate Unicode character. The exception is when you're certain the char
is 7-bit ASCII,
Daniel Stutzbach added the comment:
Yeah, this is a "I noticed this small optimization while working on something
else" kind of thing. ;) ("something else" being Issue8654)
I can make a patch to change the #if's to test Py_UNICODE_SIZE ==
SIZEOF_WCHAR_T, though I
Daniel Stutzbach added the comment:
Patch with unit test attached for MutableSet's:
x ^= x
x -= x
I was wrong about |= and &= having a problem. Since they don't mutate the set,
they don't raise an exception (they only .add items that are already in the
set). I added
Daniel Stutzbach added the comment:
Here is a revised patch based on Benjamin's comments on Rietveld.
--
Added file: http://bugs.python.org/file17433/mapping2.patch
___
Python tracker
<http://bugs.python.org/i
New submission from Daniel Stutzbach :
At the bottom of the documentation for hashlib, there's a link to
http://www.cryptography.com/cnews/hash.html
which the hashlib documentation describes as "Hash Collision FAQ with
information on which algorithms have known issues and what
Daniel Stutzbach added the comment:
I don't have a strong feeling about the method of rounding. My thinking is: If
my application is sensitive to how the last microsecond is rounded, then I
shouldn't be using a type that only gives me 1-microsecond precision.
(Likewise, if my appl
Daniel Stutzbach added the comment:
None here.
--
___
Python tracker
<http://bugs.python.org/issue8005>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Stutzbach added the comment:
I wrote a short C program to test a few different variations. It looks to me
like a bug in the operating system's implementation of HKEY_PERFORMANCE_DATA
(which is a virtual registry key). If I pass NULL as the second parameter to a
more conventiona
Daniel Stutzbach added the comment:
Yes, though it may be a while before I find time to do so.
--
___
Python tracker
<http://bugs.python.org/issue8647>
___
___
Daniel Stutzbach added the comment:
Yes, though it may be a while before I find time to do so.
--
___
Python tracker
<http://bugs.python.org/issue8646>
___
___
Daniel Stutzbach added the comment:
I'm not really clear on what PyUnicode_AsEncodedObject does (as opposed to
PyUnicode_AsEncodedString). Someone already familiar with those two functions
would have a much easier time writing a documentation
New submission from Daniel Stutzbach :
test_set_reprs in test_pprint creates a complex arrangement of frozensets and
tests the pretty-printed repr against a string hard-coded in the test. The
hard-coded repr depends on the sort order of frozensets.
However, "Since sets only define pa
New submission from Daniel Stutzbach :
reference/expressions.html#notin reads:
"Mappings (dictionaries) compare equal if and only if their sorted (key, value)
lists compare equal. [4] Outcomes other than equality are resolved
consistently, but are not otherwise defined. [5]"
Ho
Changes by Daniel Stutzbach :
--
keywords: +easy
___
Python tracker
<http://bugs.python.org/issue9132>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Stutzbach added the comment:
+1 on using the full name, PyUnicodeObject
The shorthand "PyUnicode" is too easy to confuse with Py_UNICODE (an actual
type).
--
nosy: +stutzbach
___
Python tracker
<http://bugs.python.
New submission from Daniel Stutzbach :
Simple example, using collections.OrderedDict:
>>> import collections
>>> x = collections.OrderedDict()
>>> x.update(red=5, blue=6, other=7)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lo
New submission from Daniel Stutzbach :
"Finally, the Mapping abstract base class now raises a NotImplemented
exception..."
should read "returns" instead of "raises"
Here's the relevant code patch:
http://svn.python.org/view/python/trunk/Lib/_abcoll
New submission from Daniel Stutzbach :
In Reg2Py() in winreg.c, in the REG_MULTI_SZ case, there's the following:
wchar_t **str = (wchar_t **)malloc(sizeof(wchar_t *)*s);
if (str == NULL)
return PyErr_NoMemory();
However, not all of the r
New submission from Daniel Stutzbach :
The comment before fixupMultiSZ and countString states:
** Note that fixupMultiSZ and countString have both had changes
** made to support "incorrect strings". The registry specification
** calls for strings to be terminated with 2 null bytes.
New submission from Daniel Stutzbach :
>>> isinstance({}.keys(), collections.Set)
True
>>> [method for method in set(dir(collections.Set)) - set(dir({}.keys()))
... if not method.startswith('_')]
['isdisjoint']
(in Python 2.7, use "viewkeys()&q
Changes by Daniel Stutzbach :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue9212>
___
___
Python-bugs-list mailing list
Unsubscri
New submission from Daniel Stutzbach :
>>> isinstance(range, collections.Sequence)
True
>>> [method for method in set(dir(collections.Sequence)) - set(dir(range(1)))
>>> if not method.startswith('_')]
['index', 'count']
--
Daniel Stutzbach added the comment:
In Python 2.6 and 2.7, the same problem applies to xrange objects.
--
versions: +Python 2.6, Python 2.7
___
Python tracker
<http://bugs.python.org/issue9
New submission from Daniel Stutzbach :
Attached is a simple Python 3 example script that defines a minimalist
MutableMapping that simply wraps a dict, followed by:
x = MySimpleMapping(red=5)
y = x.keys()
z = x.keys() | {'orange'} x['b
Daniel Stutzbach added the comment:
Oops. Somehow deleted a linefeed in there. The example should read:
x = MySimpleMapping(red=5)
y = x.keys()
z = x.keys() | {'orange'}
x['blue'] = 7
print(l
Daniel Stutzbach added the comment:
I guess roundup is deleting my linefeed? I'm sure I didn't do it that time.
I'm not sure what's going on there, but the "x['blue'] = 7" should be on a line
by itself.
--
_
Daniel Stutzbach added the comment:
I posted some of this earlier in the week, but for some reason the bug tracker
marked my message as spam. Hopefully this message will survive. ;-)
Can you compare and contrast your approach with calling PyObject_GC_UnTrack and
PyObject_GC_Track to mark
Changes by Daniel Stutzbach :
--
___
Python tracker
<http://bugs.python.org/issue9141>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/m
Daniel Stutzbach added the comment:
2010/7/9 Kristján Valur Jónsson
> Your message was classified as spam, I have no idea why, but this is why I
> only noticed it now.
>
Yes, I just noticed that tonight as well. I filed a bug on the meta-tracker
in the hopes that someone can dig
Daniel Stutzbach added the comment:
On Sat, Jul 10, 2010 at 1:56 AM, Terry J. Reedy wrote:
> I think this effectively impossible for volunteers. Microsoft has 1000s of
> paid employees. Chapter and Sections numbers do not match from version to
> version.
>
We don't need to
Daniel Stutzbach added the comment:
On Sat, Jul 10, 2010 at 2:12 AM, Ezio Melotti wrote:
> I think I've already discussed this with Georg a while ago and we ended up
> adding the links on the left sidebar in http://docs.python.org/.
> IIRC there's no easy way to find t
Changes by Daniel Stutzbach :
Removed file: http://bugs.python.org/file17926/unnamed
___
Python tracker
<http://bugs.python.org/issue8040>
___
___
Python-bugs-list mailin
Changes by Daniel Stutzbach :
Removed file: http://bugs.python.org/file17927/unnamed
___
Python tracker
<http://bugs.python.org/issue8040>
___
___
Python-bugs-list mailin
Daniel Stutzbach added the comment:
In this case, the concrete class is the one missing a method.
Concrete classes are allowed to provide more features than the corresponding
ABC, but the converse is not true to the best of my knowledge.
dict_keys .register()s as supporting the Set ABC, so
Changes by Daniel Stutzbach :
Removed file: http://bugs.python.org/file17925/unnamed
___
Python tracker
<http://bugs.python.org/issue9141>
___
___
Python-bugs-list mailin
Daniel Stutzbach added the comment:
Yes, I see your point. Even if more expensive than strictly necessary, the
cost should be swamped by other existing costs.
--
___
Python tracker
<http://bugs.python.org/issue9
Daniel Stutzbach added the comment:
+1 on better names, -1 on removing the reserved parameter
The parameters of OpenKey mirror those of the underlying RegOpenKey call. If
we remove the reserved parameter, then:
1) Any code currently using the sam parameter will break, since it's curr
Daniel Stutzbach added the comment:
The swap bodies technique has been used in list.sort for a long time, but users
expect list.sort to mutate the list.
Even with a pure-Python implementation of sets, I would not expect __contains__
to be a mutating method (unless I have gone out of way to
Daniel Stutzbach added the comment:
It is easy in online communications to interpret a response as a disagreement.
I apologize for falling into that trap.
I am +1 on removing implicit set-to-frozenset conversions, which would more
effectively "fix" issue8752 for me (this is the o
Daniel Stutzbach added the comment:
Jack,
The change is necessary because "None in WeakSet()" would throw an exception.
--
___
Python tracker
<http://bugs.python.
Daniel Stutzbach added the comment:
I think if they are mentioned, they should be documented. Removing mention of
them would be fine with me.
Looking at this again, I think the description of Py_TPFLAGS_DEFAULT is no
longer accurate. It reads: "This is a bitmask of all the bits
New submission from Daniel Stutzbach:
local_clear in _threadmodule.c walks the list of threads without holding
head_mutex. Since the list of threads can change when holding only head_mutex
and not on the GIL, the list can change while local_clear is executing, which
may cause Bad Things to
Daniel Stutzbach added the comment:
With regret, I have not had time to work on patches and am unlikely to have
time in the near future.
--
___
Python tracker
<http://bugs.python.org/issue9
401 - 469 of 469 matches
Mail list logo