On 20 February 2018 at 15:11, Steven D'Aprano wrote:
> So in principle, we could have a mutable class, and a immutable one, and
> when you flick the switch, the instance.__class__ changes from mutable
> to frozen.
>
> If you don't hate this, we can think about the details needed to get
> it work i
On Mon, Feb 19, 2018 at 8:16 PM, Glenn Linderman
wrote:
> On 2/19/2018 7:02 PM, Guido van Rossum wrote:
>
> But how?
>
> On Mon, Feb 19, 2018 at 5:06 PM, Chris Barker - NOAA Federal <
> chris.bar...@noaa.gov> wrote:
>
>> ... maybe it would be helpful to be able to
>> freeze an instance after crea
On Tue, Feb 20, 2018 at 8:45 AM, Guido van Rossum wrote:
> TBH, I don't hate Nick's solution that assigns to __class__ in
> __post_init__. You can probably come up with a class decorator that hides
> construction of the frozen subclass. I do think that it should be used very
> sparingly, as the e
On 2/17/2018 2:35 PM, Guido van Rossum wrote:
PS. I have to ponder why frozen dataclasses don't use `__new__`.
As I'm sure everyone is now aware after the rest of this discussion:
it's because the returned object isn't really immutable.
That said, I have threatened to create a decorator simi
On Tue, Feb 20, 2018 at 12:50 PM, Chris Barker
wrote:
> Is that one attribute that big a deal? I suppose that simple dataclasses
> with only two or so attributes would see a significant change, but if
> you're really worried about space, wouldn't you use a namedtuple or simply
> a tuple anyway?
>
On Tue, Feb 20, 2018 at 1:37 PM, Eric V. Smith wrote:
> On 2/17/2018 2:35 PM, Guido van Rossum wrote:
>
>> PS. I have to ponder why frozen dataclasses don't use `__new__`.
>>
>
> As I'm sure everyone is now aware after the rest of this discussion: it's
> because the returned object isn't really i
> On Feb 20, 2018, at 5:38 PM, Guido van Rossum wrote:
>
>> On Tue, Feb 20, 2018 at 1:37 PM, Eric V. Smith wrote:
>>> On 2/17/2018 2:35 PM, Guido van Rossum wrote:
>>> PS. I have to ponder why frozen dataclasses don't use `__new__`.
>>
>> As I'm sure everyone is now aware after the rest of thi
> On Feb 20, 2018, at 2:38 PM, Guido van Rossum wrote:
>
> But then the class would also inherit a bunch of misfeatures from tuple (like
> being indexable and having a length). It would be nicer if it used __slots__
> instead.
FWIW, George Sakkis made a tool like this about nine years ago.
Steven D'Aprano wrote:
So in principle, we could have a mutable class, and a immutable one, and
when you flick the switch, the instance.__class__ changes from mutable
to frozen.
That seems unfriendly to subclasses as well. To extend a class
you now need to subclass both the mutable and immutab
i have question:call,c-->python-->c.
1.the c pointer void* abc="123" by pycapsule in the c code.
..
void* lpContext = "abc";
PyObject * lpPyContext = PyCapsule_New(lpContext, "Context",NULL);
..
PyTuple_SetItem(pArgs, 1, lpPyContext);
PyObject* pyResult = PyObject_CallObject(pFunc, pArgs);
It's been a year and 10 days since we moved to GitHub, so I figured now is
as good a time as any to ask people if they are generally happy with the
workflow and if there is a particular sticking point to please bring it up
on the core-workflow mailing list so we can potentially address it.
Chris Barker - NOAA Federal wrote:
If I have this right, on the discussion about frozen and hash, a use
case was brought up for taking a few steps to create an instance (and
thus wanting it not frozen) and then wanting it hashable.
Which pointed to the idea of a “ freeze this from now on” method
On 2018-02-21 02:28, 赵亚 wrote:
This "python-dev" list is for development of the Python language itself.
I think that this message should instead have been sent to "python-list".
i have question:call,c-->python-->c.
1.the c pointer void* abc="123" by pycapsule in the c code.
..
void* lpCon
I have a demand:
c call python ,have a void* pointer pass to python and python call c,the void*
pointer need pass to c.
i don't know how to do,have any good idea ? thanks!___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/
hi @MRAB
i try again,it not ok. test files:
1.cpython.cpp ---c call python maintenance.py
2.maintenance.py python maintenance.py call pycapsule.cpp(dll)
the code file,see attachment.
At 2018-02-21 11:18:18, "MRAB" wrote:
>On 2018-02-21 02:28, 赵亚 wrote:
>
>This "python-dev" list is for d
Hi folks,
In the current PEP workflow, provisionally accepted PEPs are marked as
"Accepted", and remain in that state until they're declared stable and
moved to Final.
This makes it hard to identify which APIs and file formats have been
approved to have their reference implementations released (w
16 matches
Mail list logo