Re: [Python-ideas] slice[] to get more complex slices

2018-07-23 Thread Joseph Jevnik
I still think that 'operator.subscript' would be valuable to me for all of the same reasons discussed in the previous threads and issues. I don't understand why it was reverted without any serious discussion given that it was already accepted and many people find this useful. On Mon, Jul 23, 2018

Re: [Python-ideas] Do not block threads when pickle/unpickle

2018-07-16 Thread Joseph Jevnik
The GIL must be held to allocate memory for Python objects and to invoke the Python code to deserialize user defined picklable objects. I don't think there is a long span of time where the code could leave the GIL released. The Python implementation is just pausing to let other Python threads run,

Re: [Python-ideas] Add new `Symbol` type

2018-07-05 Thread Joseph Jevnik
I have also wanted sentinel objects many times. These are often useful for creating a "Not Specified" default value when explicitly passing `None` has semantic meaning. There are a few issues with the `sentinel = object()` code. One is that they don't repr well so they make debugging harder.

Re: [Python-ideas] Copy (and/or pickle) generators

2018-06-20 Thread Joseph Jevnik
This was already posted in the thread, but https://github.com/ll/cloudpickle-generators is just an extension to the standard pickle machinery and is able to support closures, nonlocals, and globals:

Re: [Python-ideas] Non-intrusive debug logging

2018-01-25 Thread Joseph Jevnik
This can be accomplished as a decorator. Jim Crist wrote a version of this using the codetransformer library. The usage is pretty simple: @trace() def sum_word_lengths(words): total = 0 for w in words: word_length = len(w) total += word_length return total >>>

Re: [Python-ideas] f-string literals by default?

2017-12-05 Thread Joseph Jevnik
This would break code that uses str.format everywhere for very little benefit. On Tue, Dec 5, 2017 at 4:19 PM, Neil Schemenauer wrote: > I think most people who have tried f-strings have found them handy. > Could we transition to making default string literal into

Re: [Python-ideas] Should Python have user-defined constants?

2017-11-20 Thread Joseph Jevnik
How is that different from "pi = 3.14"? On Tue, Nov 21, 2017 at 1:33 AM, Saeed Baig wrote: > Hey guys I am thinking of perhaps writing a PEP to introduce user-defined > constants to Python. Something along the lines of Swift’s “let” syntax (e.g. > “let pi = 3.14”). > >

Re: [Python-ideas] a new namedtuple

2017-07-17 Thread Joseph Jevnik
If we are worried about speed but want to keep the same API I have a near drop in replacement for collections.namedtuple that dramatically improves class and instance creation speed [1]. The only things missing from this implementation are `_source` and `verbose` which could be dynamically

Re: [Python-ideas] Delayed Execution via Keyword

2017-03-02 Thread Joseph Jevnik
I don't know if the state variables in a list iterator are > actually visible to the Interpreter or if it's implemented in C that is > inscrutable to the interpreter. > > > On Mar 2, 2017 5:54 PM, "Joseph Jevnik" <joe...@gmail.com> wrote: > > Other things that scr

Re: [Python-ideas] Delayed Execution via Keyword

2017-03-02 Thread Joseph Jevnik
Other things that scrutinize an expression are iteration or branching (with the current evaluation model). If `xs` is a thunk, then `for x in xs` must scrutinize `xs`. At first this doesn't seem required; however, in general `next` imposes a data dependency on the next call to `next`. For example:

Re: [Python-ideas] Delayed Execution via Keyword

2017-02-17 Thread Joseph Jevnik
the observable side-effect? On Fri, Feb 17, 2017 at 4:14 PM, Ed Kellett <edk...@gmail.com> wrote: > On Fri, 17 Feb 2017 at 19:38 Joseph Jevnik <joe...@gmail.com> wrote: > >> Delayed execution and respecting mutable semantics seems like a >> nightmare. For most indexe

Re: [Python-ideas] Delayed Execution via Keyword

2017-02-17 Thread Joseph Jevnik
Delayed execution and respecting mutable semantics seems like a nightmare. For most indexers we assume hashability which implies immutability, why can't we also do that here? Also, why do we need to evaluate callables eagerly? re the thunk replacing itself with the result instead of memoizing the

Re: [Python-ideas] Delayed Execution via Keyword

2017-02-17 Thread Joseph Jevnik
On Feb 17, 2017 12:03 AM, "Joseph Jevnik" <joe...@gmail.com> wrote: > >> You can let dask "see" into the function by entering it and wrapping all >> of the operations in `delayed`; this is how daisy[0] builds up large >> compute graphs. In this case, y

Re: [Python-ideas] Delayed Execution via Keyword

2017-02-17 Thread Joseph Jevnik
You can let dask "see" into the function by entering it and wrapping all of the operations in `delayed`; this is how daisy[0] builds up large compute graphs. In this case, you could "inline" the identity function and the delayed object would flow through the function and the call to identity never