Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Consider marking the 'L' code as deprecated and removing it in 3.1;
otherwise, this artifact may hang around forever.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Quick notes so I don't forget:
The two main pure python equivalents in the docs would need to be
updated with the new special cases (currently they raise IndexError for
rn). The other two pure python equivalents would
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Martin, do you want to make the call on this one?
--
assignee: - loewis
nosy: +loewis, rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2897
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Am closing this one. It is pointless and counter-productive unless
there is a firm decision that % formatting is definitely going away (and
migration tools have been developed). Right now, it looks like there is
some chance
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Mark, I'm somewhat uncomfortable with your proposal also. It changes
what the parser will accept and the potential benefits are almost nil.
Also, putting NaNs and Infs in complex numbers is probably not something
that should
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Because MD5 is used widely, Python needs to support it, if only to be
able to verify MD5 signatures when offered.
--
nosy: +rhettinger
resolution: - rejected
status: open - closed
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Secure hash or cryptographic hash is the correct term and I think we
should leave that in, if only to make the original intent clear and to
make them easier to search for.
I propose adding a sentence to the first paragraph
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
I concur with Mark.
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4869
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
1. This is the most important issue. Is the rn case typically an
error in the user's program or thought process. If so, then the utility
of a ValueError can be weighed against the utility of other cases where
you want combs
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Another thought before I forget: The piecewise definition of the choose
function or for binomial coefficients suggests that supporting the rn
case should be accompanied by supporting the r0 case
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
David, thanks for the data point. What does it return for
In[1]:= Permutations[{a, b, c}, {-1}]
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4816
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Data point: Microsoft Excel's PERMUT() and COMBIN() return #NUM! for
rn or r0.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4816
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Excel is returning the count, not the set itself. So, it could have
chosen to return zero.
The HP32SII also has nCr and nPr functions that return INVALID DATA for
rn or r0.
The Combinatorics section of CRC Standard
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Summary of functions/definitions expected to return a number:
rn r0 Source
- -- --
error error MS Excel PERMUT() and COMBIN()
error error
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
David, I know the OPs position and Mark's opinion. What is your
recommendation for the rn case and the r0 case?
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4816
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Attached an updated patch which expands the tests and docs.
Handles the rn case with an empty result.
Leaves the r0 case as a ValueError.
Am thinking that if we do this, it should be treated as a bug and posted
to 2.6 and 3.0
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Added file: http://bugs.python.org/file12642/combperm2.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4816
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Removed file: http://bugs.python.org/file12640/combperm.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4816
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Thanks David. Looks like we're all in agreement.
Turns out, I did a weeks worth of mulling today ;-)
Accepting the proposal with the following rationale:
1. There exist some valid use cases where rn.
2. Returning an empty
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Added file: http://bugs.python.org/file12644/combperm3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4816
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Removed file: http://bugs.python.org/file12642/combperm2.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4816
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Added file: http://bugs.python.org/file12647/combperm4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4816
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Removed file: http://bugs.python.org/file12644/combperm3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4816
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Fixed in r68394
Will forward port in a day or two.
--
resolution: accepted - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4816
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
IIRC, I think I put this here a long while ago when replacing or
removing a corresponding if-test that had always been compiled-in. The
assertion was a way of validating that the refactoring and elimination
of tests had
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Attaching an updated patch for Py2.7.
* Kept OP's simple constructor call but renamed it from counts() to
Counter():
item_counts = Counter('acabbacba')
* Followed Guido's advice and avoided subclassing from defaultdict
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Added a few more in-module tests.
Added file: http://bugs.python.org/file12664/counter2.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1696199
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Removed file: http://bugs.python.org/file12662/counter.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1696199
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Added file: http://bugs.python.org/file12665/counter3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1696199
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Removed file: http://bugs.python.org/file12664/counter2.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1696199
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
I wasn't opposing the patch. Just wanted to look back at why the
assertion was put there in the first place. If you want it in, go ahead.
--
assignee: rhettinger -
___
Python
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
The counts/counter moniker emerged from the python-dev discussion and
I'm basically happy with it since the typical usage is c=Counter(myseq)
with no other non-dict accesses (mostly just c[elem]+=1 and print
c[elem]). It's
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
I concur with David. This is not in the spirit of the doc test module.
We already have the heavy-weight unittest module as an alternative when
more firepower is needed. Also, adding more infra-structure to the this
already
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Added file: http://bugs.python.org/file12671/counter4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1696199
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
FWIW, I'm currently seeking project sponsorship to work on this. To do
it right, a substantial portion of the module should be coded in C and
needs to function independently of Python, with accessors provided to
for Python
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Go ahead with the update, but it isn't really necessary. The PEPs are
for getting something into the language in the first place and for
centralizing a major discussion. They typically get out of date quickly
after they've
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Georg, could you give this a once over before I commit? Thanks.
--
assignee: rhettinger - georg.brandl
nosy: +georg.brandl
Added file: http://bugs.python.org/file12695/counter5.diff
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Attaching an update with improved docs. Thanks for looking at this.
Added file: http://bugs.python.org/file12702/counter6.diff
___
Python tracker rep...@bugs.python.org
http
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Good catch!
--
nosy: +rhettinger
priority: - high
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4920
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Thanks for the review comments. Incorporated all suggested changes and
did some other minor tidying-up. Extended the update example to include
c.update(Counter('abcdee')). Committed as r68559 .
Decided to leave __repr__
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
The comments were incorrect.
Mutating methods always return None.
Fixed in r68570.
Needs to be ported to 2.6, 3.0, and 3.1.
--
assignee: rhettinger - georg.brandl
keywords: +26backport
nosy: +georg.brandl
resolution
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Sorry, the decimal world has it's own little world of precisely defined
and spec-mandated exceptions.
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
FWIW, the goal is to replace the opcode peephole optimizer with a more
powerful equivalent working on the AST just prior to code generation.
--
nosy: +rhettinger
___
Python tracker
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
This was discussed at the outset and the decision was a conscious one.
Do you have any particular use cases in mind (what other mutable
sequences do you reach for when you need a heap)? Or is this just a
general discussion
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
array.array is terribly slow. It is optimized for space, not speed.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4948
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
FWIW, I've launched a discussion on python-dev. If the OP is willing to
maintain the deltas over a long period of time (and perhaps provide a
buildbot for Haiku), then I fully support his effort.
--
nosy: +rhettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Here's a patch that fixes-up length_hint and it's internal callers.
I think there are plenty of other places that also swallow exceptions
but will leave those for someone who wants to look at every instance of
PyErr_Clear
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Anyone else want to pick this up from here?
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1242657
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Arghh! Decimal is NOT supposed to inherit or register with numbers.
Guido has pronounced on this and we've discussed it multiple times. See
the comments in numbers.py which were supposed to serve as a reminder.
Decimals
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Fixed the decimal issue in r68800 and r68799 .
Still needs a fix to Fractions, preferably adding an empty __slots__ to
all levels of numbers.py.
___
Python tracker rep...@bugs.python.org
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: jyasskin - marketdickinson
keywords: +patch
priority: release blocker - critical
type: - behavior
versions: +Python 2.6, Python 2.7, Python 3.1
Added file: http://bugs.python.org/file12810/fractions.diff
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Fixed in the trunk: r68813.
Benjamin, can you please apply to 2.6, 3.0 and 3.1.
--
assignee: rhettinger - benjamin.peterson
resolution: - fixed
___
Python tracker rep
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
components: +Extension Modules -None
nosy: +rhettinger
priority: - low
versions: +Python 2.7, Python 3.1 -Python 3.0
___
Python tracker rep...@bugs.python.org
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
nosy: +rhettinger
versions: +Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5034
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Am taking this under advisement but am initially disinclined. It is not
a basic itertool since it can be composed from the others. Also, it's
use cases seem to be few. One challenge for the module is that adding
more tools
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Am not too excited about this one. As a heavy itertools user myself,
I've never had occasion to need a step argument. As an implementer, I'm
aware that it would make the code for count() much more complex (because
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
The Queue module design should be followed as closely as possible. It
provides FIFO order as the default, with options for LIFO and priority
order.
--
nosy: +rhettinger
___
Python
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Am still leaning towards rejecting this one based on:
* paucity of use cases
* non-atomicity (it can be built-out of existing tools)
* minimizing the number of tools in the toolkit
* not convinced that padded tuple unpacking
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Do you have compelling use cases?
Is it worth what it takes to preserve the relation with permuations()
and product() and the lexicographic orderings?
Do we care the length of the output is no longer predictable by a simple
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Guido disallowed returning a len method on iterators. He expected
bool(it) to be False.
The recipes section of the itertools docs has code for
combinations_with_replacement(). It was not included originally because
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
+1 on this idea
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4285
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
There is already a powerset() recipe in the docs. It was contributed by
Eric Raymond.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5048
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Am rejecting the OP's request for the reasons cited.
Also rejecting the request for a __len__ method on permutations.
Ezio or Mark, please open another feature request for
combinations_with_replacement() and assign to me
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Reminder, make sure we can still break out of a while 1: pass.
--
nosy: +rhettinger
versions: +Python 2.7, Python 3.1 -Python 2.6
___
Python tracker rep...@bugs.python.org
http
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5065
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
FWIW, I added combinations_with_replacement() in r69001 and r69004 .
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5048
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
This was fixed in r60013.
--
resolution: - out of date
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1498370
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5034
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2527
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1242657
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4920
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5021
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: fdrake - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1397474
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
r69014 and r69015.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5021
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Also r69016 and r69017.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5021
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
priority: normal - high
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1242657
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
I've looked again at what it would take to update the C code and think
that the optimizations there make it difficult to add this feature
without adding a lot of code complexity and without slowing-down the
common case. Also
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Glad you like it.
Will meditate for a bit on the floating point input. My first thought
is that it isn't worth going through the __index__ dance to preclude
inputs that look odd
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Correction to earlier statement. It should have read:
Guido disallowed returning a len method on iterators. He expected
bool(it) to be always be True.
___
Python tracker rep
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Someone ought to ping Guido on this. He may have some strong thoughts
on the signature (having it sometimes return ints and sometimes floats).
But in this case, accuracy may be the more important consideration
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Guido, do you have any thoughts on this?
Basically, it's a choice between giving round() a weird signature
(sometimes returning floats and sometimes int/longs) versus having
accurate roundings of integers (which become
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
It's settled then. Input type dictates output type. No dependency on
the actual values.
--
resolution: - accepted
___
Python tracker rep...@bugs.python.org
http
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - marketdickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4707
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Fixed in r69070 and r69071.
Thanks for the bug report and patch!
--
versions: +Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4920
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4920
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
With no compelling use cases, it's not worth slowing down the module.
Am sticking with the original design decision.
--
resolution: - rejected
status: open - closed
___
Python
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
For 3.0, are you going to keep tp_compare slot in existence and just
assert that it is NULL? Then in 3.1, remove the slot entirely?
___
Python tracker rep...@bugs.python.org
http
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Am also working on a patch for this and would like to coordinate. My
first draft is attached:
Added file: http://bugs.python.org/file12891/tmp_dev_shelver.py
___
Python tracker rep
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Thanks for looking at this. I'll do an update in the next few days.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3783
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3783
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
Added file: http://bugs.python.org/file12896/dbsqlite.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3783
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Will take a look at it next week.
--
assignee: - rhettinger
nosy: +rhettinger
type: - feature request
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4124
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Am curious about your use cases. ISTM that in every case I've every
used either function, I've always known that the attribute or item is
going to be there. For instance, the original motivating use cases were
to support
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
I don't see a problem with Untabify. IDLE cannot know how big you
intended your tabs to be, so it presents a dialog asking you. That
seems reasonable to me.
In most cases, the default is pretty good -- it attempts to infer
New submission from Raymond Hettinger rhettin...@users.sourceforge.net:
From a compilation of Py3.1 r69209 :
..\..\..\sqlite-3.5.9\sqlite3.c(9702) : warning C4244: '=' : conversion
from 'double' to 'int', possible loss of data
..\..\..\sqlite-3.5.9\sqlite3.c(9703) : warning C4244
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Thanks for the review.
Fixed in r69227.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1242657
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - kbk
nosy: +kbk
priority: - high
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5129
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
They don't crash. They raise a SyntaxError because the 08 and 09
are invalid octal literals.
If you're working with decimal literals that are padded on the left with
zeroes, those need to be stripped off before conversion
New submission from Raymond Hettinger rhettin...@users.sourceforge.net:
len(obj) is not happy when obj.__len__() returns a non-number.
--
files: crasher_len.py
messages: 81024
nosy: rhettinger
priority: release blocker
severity: normal
status: open
title: SystemError when __len__
New submission from Raymond Hettinger rhettin...@users.sourceforge.net:
IDLE would be *much* easier to use in conjunction with version control
if there were a reload option that did the equivalent of (close current
with no save, followed by open current file).
--
assignee: kbk
1001 - 1100 of 9507 matches
Mail list logo