Steve Jorgensen wrote: > Simão Afonso wrote: > > On 2022-06-23 17:35:59, Steve Jorgensen wrote: > > What if, instead, the `init` parameter could accept either a boolean > > (as it does now) or a type? When given a type, that would mean that to > > created the property and accept the argument but pass the argument ti > > `__post_init__` rather than using it to initialize the property > > directly. The type passed to `init` would become the type hint for the > > argument. > > What if you wanted to create a boolean type from a function? > > Then you would pass `type=bool` Oops. That was another typo. You would pass `init=bool`. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/YAAMMAP4YWLJ5YWZG6DLFLVTBX73MFGR/ Code of Conduct: http://python.org/psf/codeofconduct/
- [Python-ideas] dataclass field argument to allow convertin... Dexter Hill
- [Python-ideas] Re: dataclass field argument to allow ... Paul Bryan
- [Python-ideas] Re: dataclass field argument to al... Simão Afonso
- [Python-ideas] Re: dataclass field argument to al... Dexter Hill
- [Python-ideas] Re: dataclass field argument to allow ... Steve Jorgensen
- [Python-ideas] Re: dataclass field argument to al... Steve Jorgensen
- [Python-ideas] Re: dataclass field argument to al... Simão Afonso
- [Python-ideas] Re: dataclass field argument t... Steve Jorgensen
- [Python-ideas] Re: dataclass field argume... Steve Jorgensen
- [Python-ideas] Re: dataclass field argument to al... Dexter Hill
- [Python-ideas] Re: dataclass field argument t... Steve Jorgensen
- [Python-ideas] Re: dataclass field argume... Dexter Hill
- [Python-ideas] Re: dataclass field a... Steve Jorgensen
- [Python-ideas] Re: dataclass fie... Dexter Hill
- [Python-ideas] Re: dataclass... Steve Jorgensen
- [Python-ideas] Re: dataclass... Paul Bryan
- [Python-ideas] Re: dataclass... Steve Jorgensen
- [Python-ideas] Re: dataclass... Paul Bryan
- [Python-ideas] Re: dataclass... Dexter Hill