Nathaniel,
On 2016-10-19 5:02 PM, Nathaniel Smith wrote:
Hi Yury,
Thanks for the detailed comments! Replies inline below.
NP!
On Wed, Oct 19, 2016 at 8:51 AM, Yury Selivanov wrote:
I'm -1 on the idea. Here's why:
1. Python is a very dynamic language with GC
On Wed, Oct 19, 2016 at 2:38 PM, Paul Moore wrote:
> On 19 October 2016 at 19:13, Chris Angelico wrote:
> > Now it *won't* correctly call the end-of-iteration function, because
> > there's no 'for' loop. This is going to either (a) require that EVERY
> >
On 2016-10-19 3:33 PM, Nathaniel Smith wrote:
lst = [1,2,3,4]
>it = iter(lst)
>for i in it:
>>... if i == 2: break
>>
>for i in it:
>>... print(i)
>>3
>>4
>
>>
>>With the proposed behaviour, if I understand it, "it" would be closed
>>after the first loop, so resuming
On 2016-10-19 12:21, Nathaniel Smith wrote:
>Also, unless I'm misunderstanding the proposal, there's a fairly major
>compatibility break. At present we have:
>
lst = [1,2,3,4]
it = iter(lst)
for i in it:
>... if i == 2: break
>
for i in it:
>... print(i)
>3
>4
>
FWIW, you probably _don't_ want to use `ndarray` directly. Normally, you
want to use the `np.array` factory function...
>>> import numpy as np
>>> a = np.ndarray([0, 1, 2])
>>> a
array([], shape=(0, 1, 2), dtype=float64)
Aside from that, my main problem with this proposal is that it seems to
On Wed, Oct 19, 2016 at 4:47 PM, Matt Gilson wrote:
> FWIW, you probably _don't_ want to use `ndarray` directly. Normally, you
> want to use the `np.array` factory function...
>
> >>> import numpy as np
> >>> a = np.ndarray([0, 1, 2])
> >>> a
> array([], shape=(0, 1, 2),
On 19 October 2016 at 20:21, Nathaniel Smith wrote:
> On Wed, Oct 19, 2016 at 11:38 AM, Paul Moore wrote:
>> On 19 October 2016 at 19:13, Chris Angelico wrote:
>>> Now it *won't* correctly call the end-of-iteration function, because
>>>
On Wed, Oct 19, 2016 at 12:21 PM, Nathaniel Smith wrote:
> On Wed, Oct 19, 2016 at 11:38 AM, Paul Moore wrote:
>> On 19 October 2016 at 19:13, Chris Angelico wrote:
>>> Now it *won't* correctly call the end-of-iteration function, because
On Wed, Oct 19, 2016 at 1:33 PM, Yury Selivanov wrote:
> On 2016-10-19 3:33 PM, Nathaniel Smith wrote:
>
>>> lst = [1,2,3,4]
>>> >it = iter(lst)
>>> >for i in it:
>>... if i == 2: break
>>
>>>
>>> >for i in it:
On Wed, Oct 19, 2016 at 3:24 PM, Thomas Nyberg wrote:
> Personally I like the way that numpy does it now better (even for
> multidimensional arrays). Being able to index into the different sub
> dimension using just [] iteratively matches naturally with the data
> structure
On 19 October 2016 at 21:08, Todd wrote:
>
> a = np.ndarray(48, 11, 141, 13, -60, -37, 58, -52, -29, 134],
> [-6, 96, -66, 137, -59, -147, -118, -104, -123, -7]],
> [[-103, 50, -89, -12, 28, -12, 119, -131, -73, 21],
>
Hi Yury,
Thanks for the detailed comments! Replies inline below.
On Wed, Oct 19, 2016 at 8:51 AM, Yury Selivanov wrote:
> I'm -1 on the idea. Here's why:
>
>
> 1. Python is a very dynamic language with GC and that is one of its
> fundamental properties. This proposal
On Wed, Oct 19, 2016 at 3:55 PM, Joseph Jevnik wrote:
> You could add or prototype this with quasiquotes (http://quasiquotes.
> readthedocs.io/en/latest/). You just need to be able to parse the body of
> your expression as a string into an array. Here is a quick example with a
On Wed, Oct 19, 2016 at 11:38 AM, Paul Moore wrote:
> On 19 October 2016 at 19:13, Chris Angelico wrote:
>> Now it *won't* correctly call the end-of-iteration function, because
>> there's no 'for' loop. This is going to either (a) require that EVERY
>>
+1.
I read many disagreements, and people being rude and unprofessional on
occasions, but nothing that would make me have a bad day, even when I
was the target of it.
I feel like people are really getting hyper sensitive about
communications. While I do prefer talking to calm rational
On 17 October 2016 at 09:08, Nathaniel Smith wrote:
> Hi all,
Hi Nathaniel. I'm just reposting what I wrote on pypy-dev (as
requested) but under the assumption that you didn't substantially
alter your draft - I apologise if some of the quoted text below has
already been edited.
On 19 October 2016 at 12:33, Oscar Benjamin wrote:
>
>> New convenience functions
>> -
>>
>> The ``itertools`` module gains a new iterator wrapper that can be used
>> to selectively disable the new ``__iterclose__`` behavior::
>>
>> # XX
Thanks Nathaniel for this great proposal.
As I went through your mail, I realized all the comments I wanted to
make were already covered in later paragraphs. And I don't think there's
a single point I disagree with.
I don't have a strong opinion about the synchronous part of the
proposal. I
On 2016-10-19 6:07 PM, Paul Moore wrote:
I missed that you propose phasing this in, but it doesn't really alter
much, I think the current behaviour is valuable and common, and I'm -1
on breaking it. It's just too much of a fundamental change to how
loops and iterators interact for me to be
a few thoughts:
On Wed, Oct 19, 2016 at 12:08 PM, Todd wrote:
> I have been thinking about how to go about having a multidimensional array
> constructor in python. I know that Python doesn't have a built-in
> multidimensional array class and won't for the foreseeable
On 10/19/2016 09:04 PM, Elliot Gorokhovsky wrote:
A quick note:
I'm working on a special-case compare function for bounded integers for
the sort stuff. By looking at the implementation, I figured out that
Py_SIZE of a long is the sign times the number of digits (...right?).
Before looking at
On 10/19/2016 12:38 AM, Nathaniel Smith wrote:
I'd like to propose that Python's iterator protocol be enhanced to add
a first-class notion of completion / cleanup.
With respect the the standard iterator protocol, a very solid -1 from
me. (I leave commenting specifically on __aiterclose__ to
On Wed, Oct 19, 2016 at 7:48 PM, Chris Barker wrote:
>
>
> However, if you really don't like it, then you can pass a string to
aconfsturctor function instead:
>
> a = arr_from_string(" | 0, 1, 2 || 3, 4, 5 | ")
>
> yeah, you need to type the extra quotes, but that's not
On Wed, Oct 19, 2016 at 7:48 PM, Chris Barker wrote:
> a few thoughts:
>
> On Wed, Oct 19, 2016 at 12:08 PM, Todd wrote:
>
>> I have been thinking about how to go about having a multidimensional
>> array constructor in python. I know that Python
Hey Nathaniel - I like the intent here, but I think perhaps it would
be better if the problem is approached differently.
Seems to me that making *generators* have a special 'you are done now'
interface is special casing, which usually makes things harder to
learn and predict; and that more the
[Elliot Gorokhovsky ]
> I'm working on a special-case compare function for bounded integers for the
> sort stuff. By looking at the implementation, I figured out that Py_SIZE of
> a long is the sign times the number of digits (...right?).
> ...
Please ignore the
It's in the code. See longobject.c:
Py_SIZE(v) = ndigits*sign;
You can also see Py_SIZE(v) used on PyLongs all over the place in
longobject.c, for example:
v = (PyLongObject *)vv;
i = Py_SIZE(v);
Just do a ctrl-f for Py_SIZE(v) in longobject.c. Like I said, by looking in
the
On Wed, Oct 19, 2016 at 03:08:21PM -0400, Todd wrote:
[taking your later comment out of the order it was written]
> If this sort of thing doesn't interest you I won't be offended if you stop
> reading now, and I apologize if it is considered off-topic for this ML.
No problem Todd, we shouldn't
This is a very interesting proposal. I just wanted to share something I
found in my quick search:
http://stackoverflow.com/questions/14797930/python-custom-iterator-close-a-file-on-stopiteration
Could you explain why the accepted answer there doesn't address this issue?
class Parse(object):
A quick note:
I'm working on a special-case compare function for bounded integers for the
sort stuff. By looking at the implementation, I figured out that Py_SIZE of
a long is the sign times the number of digits (...right?). Before looking
at the implementation, though, I had looked for this info
I'm -1 on the idea. Here's why:
1. Python is a very dynamic language with GC and that is one of its
fundamental properties. This proposal might make GC of iterators more
deterministic, but that is only one case.
For instance, in some places in asyncio source code we have statements
like
On Wed, Oct 19, 2016 at 3:38 AM, Neil Girdhar wrote:
> This is a very interesting proposal. I just wanted to share something I
> found in my quick search:
>
> http://stackoverflow.com/questions/14797930/python-
> custom-iterator-close-a-file-on-stopiteration
>
> Could you
On 2016-10-19 12:38 PM, Random832 wrote:
On Wed, Oct 19, 2016, at 11:51, Yury Selivanov wrote:
I'm -1 on the idea. Here's why:
1. Python is a very dynamic language with GC and that is one of its
fundamental properties. This proposal might make GC of iterators more
deterministic, but that is
On Wed, Oct 19, 2016 at 11:08 AM Todd wrote:
> On Wed, Oct 19, 2016 at 3:38 AM, Neil Girdhar
> wrote:
>
> This is a very interesting proposal. I just wanted to share something I
> found in my quick search:
>
>
>
On 19 October 2016 at 19:13, Chris Angelico wrote:
> Now it *won't* correctly call the end-of-iteration function, because
> there's no 'for' loop. This is going to either (a) require that EVERY
> consumer of an iterator follow this new protocol, or (b) introduce a
> ton of edge
On 19 October 2016 at 12:29, Michel Desmoulin wrote:
> I feel like people are really getting hyper sensitive about communications.
> While I do prefer talking to calm rational people with a friendly tone, I
> acknowledge this is not always the case and it's ok if
On Wed, Oct 19, 2016 at 10:08 AM, Neil Girdhar wrote:
>
>
> On Wed, Oct 19, 2016 at 11:08 AM Todd wrote:
>>
>> On Wed, Oct 19, 2016 at 3:38 AM, Neil Girdhar
>> wrote:
>>>
>>> This is a very interesting proposal. I just wanted to
On Thu, Oct 20, 2016 at 3:38 AM, Random832 wrote:
> On Wed, Oct 19, 2016, at 11:51, Yury Selivanov wrote:
>> I'm -1 on the idea. Here's why:
>>
>>
>> 1. Python is a very dynamic language with GC and that is one of its
>> fundamental properties. This proposal might make
I have been thinking about how to go about having a multidimensional array
constructor in python. I know that Python doesn't have a built-in
multidimensional array class and won't for the foreseeable future.
However, some projects have come up with their own ways of making it
simpler to create
39 matches
Mail list logo