Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 712 -- Adding a “converter” parameter to dataclasses.field #206

Open
6 tasks done
thejcannon opened this issue Aug 31, 2023 · 10 comments
Open
6 tasks done

PEP 712 -- Adding a “converter” parameter to dataclasses.field #206

thejcannon opened this issue Aug 31, 2023 · 10 comments
Labels
PEP Python Enhancement Proposal

Comments

@thejcannon
Copy link

thejcannon commented Aug 31, 2023

Pretty pretty please consider PEP 712 -- Adding a “converter” parameter to dataclasses.field
https://peps.python.org/pep-0712/

  • The PEP has been discussed in threads listed in its Post-History header
  • The PEP was announced on Discuss (link in Post-History)
  • The PEP includes all relevant Suggested Sections
  • The PEP includes endorsements from the projects/groups/people it helps
  • The PEP has a CODEOWNERS entry
  • The PEP author is really excited to simply be making a PEP, and is extremely grateful and honored by the Steering Council's time and effort put into this PEP and beyond ❤️
@thejcannon thejcannon added the PEP Python Enhancement Proposal label Aug 31, 2023
@thejcannon
Copy link
Author

Hope everyone is having a good time.

Here's a gif from one of my favorite movies, Clue. I think it's representative of how I imagine the SC discusses, and then announces decisisons 😄

clue

@gpshead
Copy link
Member

gpshead commented Nov 14, 2023

Thanks for the nice PEP! We've posted our initial reply: https://discuss.python.org/t/pep-712-adding-a-converter-parameter-to-dataclasses-field/26126/57

This SC is not leaning towards accepting this PEP as is, but we are open to being convinced by the community to change our minds (realistically: letting the next elected SC change their minds). Thus, keeping this issue open.

@thejcannon
Copy link
Author

@gpshead I guess that makes you Tim Curry 😄

@thejcannon
Copy link
Author

In keeping the comments mirrored between here and Discourse: https://discuss.python.org/t/pep-712-adding-a-converter-parameter-to-dataclasses-field/26126/58?u=thejcannon

Specifically, what's the gut-feel on rejection of this, but approval of a scoped-down version only to dataclass_transform. Currently typecheckers either don't handle or special-case attrs's conversion semantics, which means any other library (first or third party) is un-typecheckable.

@gpshead
Copy link
Member

gpshead commented Nov 22, 2023

My personal gut feel is that there is still a way forward to the ultimate feature people are wanting behind all of this (without the existing "just override dunder methods" approach or a "just go use attrs" disappointment). I haven't had time to settle on my thoughts. I'll follow up on the Discuss thread once I do. I suggest we keep all conversation there on Discuss. Scoping it to dataclass_transform might make sense - see what others say on thread. (I haven't caught up with and re-read the current discussion)


Like I tried to have our SC response say: This isn't rejected yet, we just weren't convinced yet and our default response is not a presumed "yes" in that scenario.

Our goal is for more collective consensus on why, one way or another. There is clearly user support for the conversion concept. So future 2024-SC after more public discussion (and probably updates to the PEP to record whatever comes of that) still has time to consider it for 3.13, and if future-SC does ultimately reject it, we should better explain why (ideally in unsurprising ways that should already be reflected somewhere within the discussion thread by that point).

@hauntsaninja
Copy link

We’re not always ready for it or upon inspection find that the PEP could use more discussion, and by the time we make ourselves time to come to this realization that can mean a delayed reply that doesn’t please anyone (like our PEP-712 response and the feeling of limbo you I suspect some feel we left that in).

(quoting from gpshead's SC nomination)

Just wanted to chime in and say that I actually really appreciated the SC's approach to this PEP. I thought the feedback was very concrete and allowed for an element of clearly constrained dialogue that I think is healthy and hopefully will help us all make decisions with more clarity.

@thejcannon
Copy link
Author

As the PEP author, I like the candor. I like the SC wanting to participate in the discussion, and the earlier the better. That certainly feels more like "steering". And honesty is great.

However, I think this particular messaging might've been a little too honest. Divulging that as-is it's unlikely to go in, turned it from conversation to convincing. That's reflected in the tone of the replies.

So I love the direction, not so much the execution of this one 🥲

(If anyone wants to continue this discussion, let's start a thread on Discourse, I'll copy my reply there)

@brettcannon
Copy link
Member

However, I think this particular messaging might've been a little too honest. Divulging that as-is it's unlikely to go in, turned it from conversation to convincing. That's reflected in the tone of the replies.

Unfortunately the alternative is outright rejection. The SC basically accepts, rejects, or sends PEPs back for changes; we don't really have other options here when it comes to PEPs sent to us.

If you would prefer to not deal with the replies on Discourse you can withdraw the PEP yourself or tell us you do not want to change the PEP, in which case we can reject it. Otherwise this is part of the overall PEP process.

@thejcannon
Copy link
Author

The SC basically accepts, rejects, or sends PEPs back for changes; we don't really have other options here when it comes to PEPs sent to us.

Perhaps I'm just really dense (it's a real possibility), but the decision post on Discourse didn't scream "this PEP was sent back for changes".

To quote:

Q: Is there a compelling reason for dataclass field converters to be in the standard library that we’re just missing?

It is good to see people piping up on this thread who do want the feature. It would be interesting to know how important that is and if you already do, or why you don’t, use something like attrs today just to have it.

The answer, to me, felt like "we want to see more discussion before we're convinced", which my impression was that, divulging it's on the path to rejection, set the tone for the discussion.


Now, it could also be that I just completely missed the "we're sending your PEP back for revision" in the message. In which case, as feedback from a first-time PEPer, that should ideally be stated clearly 😅 and I'll try and aggregate the discussion into a more convincing argument.

@brettcannon
Copy link
Member

Perhaps I'm just really dense (it's a real possibility), but the decision post on Discourse didn't scream "this PEP was sent back for changes".

To quote:

Q: Is there a compelling reason for dataclass field converters to be in the standard library that we’re just missing?
It is good to see people piping up on this thread who do want the feature. It would be interesting to know how important that is and if you already do, or why you don’t, use something like attrs today just to have it.

The answer, to me, felt like "we want to see more discussion before we're convinced", which my impression was that, divulging it's on the path to rejection, set the tone for the discussion.

It's our job to be honest, not to win support for your PEP. I'm sorry if you didn't like that honesty, but it was either that or rejection. We prefer to be open about why we are sending a PEP back for more consideration instead of accepting it or rejecting it, else people ask. Otherwise the other option was rejecting it outright and we assumed you would have preferred not for that to happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PEP Python Enhancement Proposal
Projects
None yet
Development

No branches or pull requests

4 participants