On Sat, Dec 17, 2016 at 5:12 PM, Steve D'Aprano
wrote:
> On Sat, 17 Dec 2016 03:55 pm, Chris Angelico wrote:
>
>> More than that: the lists are searched in linear time, the binary
>> seach runs in logarithmic time, but the set lookup is constant time.
>> Doesn't matter how big your set is, you can
On Sat, 17 Dec 2016 03:55 pm, Chris Angelico wrote:
> More than that: the lists are searched in linear time, the binary
> seach runs in logarithmic time, but the set lookup is constant time.
> Doesn't matter how big your set is, you can test for membership with
> one hash lookup.
To be pedantic:
On behalf of the Python development community and the Python 3.6 release
team, I would like to announce the availability of Python 3.6.0rc2. 3.6.0rc2
is the second release candidate for Python 3.6, the next major release of
Python.
Code for 3.6.0 is now frozen. 3.6.0rc2 is the same code base as t
On Sat, Dec 17, 2016 at 3:44 PM, wrote:
>> python3 listsearch.py
> Python version: sys.version_info(major=3, minor=5, micro=2,
> releaselevel='final', serial=0)
> building hashes...
> sorting...
> creating set...
> Unsorted list: 1.7384763684627569
> Sorted: 9.248799958145042
> set: 1.461416129
On Sat, Dec 17, 2016 at 3:42 PM, Veek M wrote:
> If it walks like a duck and talks like a duck, it’s a duck, right? So if
> this duck is not giving you the noise that you want, you’ve got to just
> punch that duck until it returns what you expect. -Patrick Ewing on
> Monkey/Duck patching in RailsC
On Friday, December 16, 2016 at 6:27:24 PM UTC-8, Chris Angelico wrote:
> On Sat, Dec 17, 2016 at 1:20 PM, wrote:
> > I thought this was curious behavior. I created a list of random-looking
> > strings, then made a sorted copy. I then found that using "in" to see if a
> > string exists in the
Steven D'Aprano wrote:
> On Wednesday 14 December 2016 17:11, Veek M wrote:
>
>> I know that with user classes one can define getattr, setattr to
>> handle dictionary lookup. Is there a way to hook into the native
>> dict() type and see in real time what's being queried.
>
> Not easily, and mayb
On 2016-12-16 08:16 PM, Dennis Lee Bieber wrote:
Unfortunately, my client can only "pre filter" on subject and author; I
could kill all @gmail.*, but could not focus on just Google Groups
submissions...
I don't know what client you use but perhaps you can adapt this procmail
recipe.
Hello,
Is there an easier way to write a numpy array with a regular structure?
For example, an array with [0, 1] along the diagnal of one of the array
dimensions, and zero elsewhere:
zz = np.array([[[0, 1], [0, 0], [0, 0]],
[[0, 0], [0, 1], [0, 0]],
[[0, 0], [0, 0],
On Sat, Dec 17, 2016 at 1:20 PM, wrote:
> I thought this was curious behavior. I created a list of random-looking
> strings, then made a sorted copy. I then found that using "in" to see if a
> string exists in the sorted list took over 9 times as long!
>
My numbers replicate yours (though my
Alternatively...why you should definitely use binary searches:
Python 3.5.2+ (default, Aug 30 2016, 19:08:42)
[GCC 6.2.0 20160822] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> import timeit
>>> hashes = [hashlib.md5(bytes(str(i), "utf-8")
On 16/12/2016 14:27, Steve D'Aprano wrote:
(2) The clever solution: use a pair of lists, one holding the starting value
of each group of keys, and the other holding the common values. This saves
a lot of memory, but is slower.
A concrete example might help. Suppose I have 15 keys in five groups
On Fri, Dec 16, 2016 at 4:06 AM, Steve D'Aprano
wrote:
> I have about a million or two keys, with a few hundred or perhaps a few
> thousand distinct values. The size of each contiguous group of keys with
> the same value can vary from 1 to perhaps a hundred or so.
Going right back to the beginnin
On Thursday, 15 December 2016 17:06:39 UTC, Steve D'Aprano wrote:
> I have some key:value data where the keys often are found in contiguous
> ranges with identical values. For example:
>
> {1: "foo",
> 2: "foo",
> 3: "foo",
> # same for keys 4 through 99
> 100: "foo",
> 101: "bar",
> 102: "
On 16/12/2016 16:12, D'Arcy Cain wrote:
On 2016-12-16 10:11 AM, Grant Edwards wrote:
I didn't notice much spam on c.l.p (but then again, I filter out all
posts from google-groups). The problem on c.l.p that caused me to
Yes, blocking GG was the biggest improvement to my reading this list
(mai
On 2016-12-16 10:11 AM, Grant Edwards wrote:
I didn't notice much spam on c.l.p (but then again, I filter out all
posts from google-groups). The problem on c.l.p that caused me to
Yes, blocking GG was the biggest improvement to my reading this list
(mailing list in my case). That and a few j
On 12/15/2016 11:57 PM, Terry Reedy wrote:
On 12/15/2016 4:30 PM, Thomas Nyberg wrote:
On 12/15/2016 12:48 PM, Terry Reedy wrote:
A sparse array has at least half missing values. This one has none on
the defined domain, but contiguous dupicates.
I'm sorry for devolving into semantics, but t
On 2016-12-16, Dennis Lee Bieber wrote:
> On Thu, 15 Dec 2016 13:34:32 -0500, Terry Reedy declaimed
> the following:
>>
>>If you want to read python-list as a news group, you might try
>>news.gmane.org. About once a year, it goes down for a few hours to a
>>day, but has otherwise been dependa
Hello, this week-end is the last two days for the Call For Proposals of
PythonFOSDEM 2017. We have received a lot of topics, but if you want to
become a speaker and that you have a very cool topic to submit, please
don't hesite and send us your proposal.
Deadline is 2016-12-18.
Stephane
Cal
On Wed, 14 Dec 2016, 01:06 Skip Montanaro, wrote:
I know this isn't a Python-specific question, but i got zero useful
responses from the help-gnu-emacs list for some reason. I think this
expression should not evaluate to the empty set:
set(python_programmers) & set(emacs_users) & set(new_macbook
On Fri, 16 Dec 2016 04:06 am, Steve D'Aprano wrote:
> I have some key:value data where the keys often are found in contiguous
> ranges with identical values.
[...]
Thank you to everyone who gave suggestions!
I have experimented with two solutions, and hope somebody might be able to
suggest some
A nice chinese-like saying might have come out of this, perhaps it even already
exists:
"When you confused, the answer might be fused !" :)
Sounds like TZen Su ! That dude from Art of War or something like that :)
I will take this chance to correct a little pretty obvious typo corrected:
(*)
Hi thanks for your (Dennis) reply,
You seem to have two main questions:
1. Is the attack order sequential in time or is it positional ?
The answer to this question is kinda:
Both, (which is kinda funny, since you did not think of this possibility that
it could be both, which you also did with
On 12/15/2016 4:30 PM, Thomas Nyberg wrote:
On 12/15/2016 12:48 PM, Terry Reedy wrote:
On 12/15/2016 12:27 PM, Thomas Nyberg wrote:
I haven't dealt with a data structure exactly like this, but it's
basically a sparse array.
A sparse array has at least half missing values. This one has none
24 matches
Mail list logo