On Mon, Jun 18, 2018 at 09:20:25PM -0400, Juancarlo Añez wrote:
> >> For all practical purpose, it would be enough to define that the
> >> expression:
> >>
> >> mylist += [item]
> >>
> >> gets optimized to mylist.append(item).
What if mylist doesn't have an append method?
Just because the variabl
On Mon, Jun 18, 2018 at 07:23:50PM -0700, Chris Barker wrote:
> Though if someone really wants to implement trig in native degrees -- more
> power to 'em.
>
> However -- if this is really such a good idea -- wouldn't someone have make
> a C lib that does it? Or has someone? Anyone looked?
No, th
On Tue, Jun 19, 2018 at 3:52 AM, Juancarlo Añez wrote:
>
>> The idea is to introduce new syntax for the list.append() method.
>>
>>
>> Syntax:
>>
>> Variant 1.
>> Use special case of index, namely omitted index:
>>
>> mylist[] = item
>
>
> For all practical purpose, it would be enough to defin
Hello,
because Python is a very dynamic language the memory management is heavily
used. A lot of time is used for creating (reserve memory and fill object
structure with data) and destroying objects.
Because of this and because of the discussions about the GIL I was
wondering if there isn't a sol
On Tue, 19 Jun 2018 16:47:46 +0200
Martin Bammer wrote:
> Hello,
>
> because Python is a very dynamic language the memory management is heavily
> used. A lot of time is used for creating (reserve memory and fill object
> structure with data) and destroying objects.
Do you have numbers about that
On Tue, Jun 19, 2018 at 04:47:46PM +0200, Martin Bammer wrote:
> And here comes the idea for POPT. With this idea the Python interpreter has
> running several threads in background (1 thread for each object type)
The builtins alone has 47 exception types. I hope you don't mean that
each of thos
I've only recently looked for these special methods, so that in and of
itself may be the reason these methods aren't exposed, but I could think of
objects that may wish to implement __min__ and __max__ themselves, for
efficiency. For example:
# A "self-sorted" list object
class AlwaysSort
Do you mind sharing an example usage in a realistic context? There might be
a good solution that doesn't require adding magic methods.
On Tue, Jun 19, 2018, 12:24 PM James Edwards wrote:
> I've only recently looked for these special methods, so that in and of
> itself may be the reason these me
Well, numpy implements ndarray.min(). It would be very nice if
min(np.array) worked as expected.
Pål
On 19 Jun 2018 21:33, "Michael Selik" wrote:
> Do you mind sharing an example usage in a realistic context? There might
> be a good solution that doesn't require adding magic methods.
>
>
> On T
Add a function to generator objects to copy the entire state of it:
Proposed example code:
game1 = complicated_game_type_thing()
# Progress the game to the first decision point
choices = game1.send(None)
# Choose something
response = get_a_response(choices)
# Copy the game generator
game2 = ga
The state of a generator is not much more that a single Python stack frame
plus an integer indicating where in the bytecode the resume point is. But
copying/pickling a stack frame is complicated -- it's not just all the
locals but also the try/except stack and the expression evaluation stack.
Have
You might find this useful, either to use directly or as a source of
inspiration:
https://github.com/ll/cloudpickle-generators
-n
On Tue, Jun 19, 2018, 15:55 Micheál Keane wrote:
>
> Add a function to generator objects to copy the entire state of it:
>
> Proposed example code:
>
> game
>
> [snip]
>
> As Python is being increasingly used for data science, this use case will
> be increasingly common. Being able to copy generators will save a lot of
> work.
>
> Keep in mind, I don't necessarily propose that generators should be fully
> picklable; there are obviously a number of conc
On Tue, Jun 19, 2018 at 12:33:15PM -0700, Michael Selik wrote:
> Do you mind sharing an example usage in a realistic context? There might be
> a good solution that doesn't require adding magic methods.
You have some sort of binary search tree that is iterated over in some
arbitrary order. Callin
19.06.18 22:18, James Edwards пише:
I've only recently looked for these special methods, so that in and of
itself may be the reason these methods aren't exposed, but I could think
of objects that may wish to implement __min__ and __max__ themselves,
for efficiency.
There are two questions.
1
Am 2018-06-19 um 18:00 schrieb [email protected]:
Re: POPT (Python Ob ject Provider Threads) (Antoine Pitrou)
Currently it's just an idea. I didn't have the time yet to create a
prototype implementation.
___
Python-ideas mailing list
16 matches
Mail list logo