On 18.10.15 01:20, Eric Snow wrote:
On the tracker he notes another OrderedDict compatibility break:
Backward compatibility related to __class__ assignment was
already broken in C implementation. In 3.4 following code
works:
>>> from collections import *
>>> class
Yes, randrange(n) does that.
--Guido (mobile)
On Oct 17, 2015 2:28 PM, "Brian Gladman" wrote:
> > Guido van Rossum wrote:
>
> > I'm fine with dropping the 3rd arg. But I find the argument to
> > introduce a new spelling for 1-arg randrange() weak.
>
> I should stress that
OK, so just randbelow() then.
--Guido (mobile)
On Oct 17, 2015 2:13 PM, "Tim Peters" wrote:
> [Steven D'Aprano]
> >> ...
> >> I think it is fair to say that out of the three functions, there is
> >> consensus that randbelow has the most useful functionality in a crypto
>
A recent discussion in a tracker issue [1] brought up the matter of
compatibility between the pure Python implementation of OrderedDict
and the new C implementation. In working on that port I stuck as
closely as possible to the Python implementation. This meant some
parts of the code are bit
On 18.10.15 00:45, Eric Snow wrote:
In a recent tracker issue about OrderedDict [1] we've had some
discussion about the use of type(od) as a replacement for
od.__class__. It came up because the pure Python implementation of
OrderedDict uses self.__class__ in 3 different methods (__repr__,
On Sat, Oct 17, 2015 at 03:45:19PM -0600, Eric Snow wrote:
> In a recent tracker issue about OrderedDict [1] we've had some
> discussion about the use of type(od) as a replacement for
> od.__class__.
[...]
> The more general question of when we use type(obj) vs. obj.__class__
> applies to both
Brian Gladman writes:
>> On Sat, Oct 17, 2015 at 03:26:46AM +1100, Steven D'Aprano wrote:
> I hence support your conclusion that the module should offer randbelow
> alone. I would oppose offering randomrange (or offering more than one
> of them) since this will pretty
On Sat, Oct 17, 2015 at 03:26:46AM +1100, Steven D'Aprano wrote:
> On Fri, Oct 16, 2015 at 06:35:14PM +0300, Serhiy Storchaka wrote:
>
> > I suggest to add only randrange(). randint() is historical artefact, we
> > shouldn't repeat this mistake in new module. The secrets module is not
> > good
On Sat, Oct 17, 2015 at 2:50 AM, Steven D'Aprano
wrote:
> [...]
> So you can see there is nothing even close to consensus as to which API
> is best, which is an argument for keeping all three functions.
>
No, that's not how we do it in Python. :-)
> But significanly, only
Guido van Rossum writes:
> On Sat, Oct 17, 2015 at 2:50 AM, Steven D'Aprano
> wrote:
>
> [...]
> So you can see there is nothing even close to consensus as to
> which API
> is best, which is an argument for keeping all three functions.
>
>
Hi All,
I'm currently programming a set of crypto challenges in order to get a
deeper understanding of python and crypto. The problem is to break a
repeating key xor data (in a file). In order to do that I need a function
to calculate the hamming distance between two strings. To find that one
This list is for discussion of development of the Python core language and
standard libraries, not for development *using* Python. It sounds like you
should probably do your homework problem on your own, actually, but if you
seek advice, something like StackOverflow or python-list are likely to
> On Sat, Oct 17, 2015 at 03:26:46AM +1100, Steven D'Aprano wrote:
[snip]
> But significanly, only *one* of the commenters has claimed to have
> any significant experience in crypto work, and I will quote him:
I didn't specifically claim the experience you requested in responding
to your post on
[Steven D'Aprano]
>> ...
>> I think it is fair to say that out of the three functions, there is
>> consensus that randbelow has the most useful functionality in a crypto
>> context. Otherwise, people seem roughly equally split between the three
>> functions. There doesn't seem to be any use-case
> Guido van Rossum wrote:
> I'm fine with dropping the 3rd arg. But I find the argument to
> introduce a new spelling for 1-arg randrange() weak.
I should stress that my preference for randbelow over randrange was
based purely on their proposed functionality and not on their names.
I do however
In a recent tracker issue about OrderedDict [1] we've had some
discussion about the use of type(od) as a replacement for
od.__class__. It came up because the pure Python implementation of
OrderedDict uses self.__class__ in 3 different methods (__repr__,
__reduce__, and copy). The patch in that
16 matches
Mail list logo