Evan Hubinger

Results 136 comments of Evan Hubinger

@dileep-kishore The problem with `dataclass` from a functional standpoint is that data classes are mutable. Coconut's `data` types, on the other hand, are immutable. That's very important if you're doing...

@benji-york Really? I didn't know that. I don't see it in the PEP, though--where's the source for that?

Though `dataclass` won't be replacing `data`, I think it would be really nice to have Coconut port `dataclass` to work on any Python version, so I'm going to reopen this...

@dileep-kishore Ah, I see. Yeah, I'd definitely like to use Coconut to port `dataclass` to older Python versions, though I still won't be removing `data`, since there are still things...

@majidaldo What sort of ecosystem support are you referring to? Can you provide an example of a situation where an `attr`/`dataclass`-based `data` would be able to do something that a...

> serialization, evolution, conversion @majidaldo `.asdict()` is already available as [`._asdict()`](https://docs.python.org/3/library/collections.html#collections.somenamedtuple._asdict). Field transformation is possible via pattern-matching (see below) or writing a `__new__` and updating is possible via [`._replace`](https://docs.python.org/3/library/collections.html#collections.somenamedtuple._replace). `cattrs`...

> on another note, attrs just completely solves what you might want out of dataclasses. @majidaldo Perhaps the better question, then, since you can just `import attrs` in Coconut, is...

@Nexus6 Yeah, I totally agree that this would be useful--it's something I've been wanting to implement since I resolved #159. Putting this issue on the v1.2.1 milestone.

As per Gitter discussion, implementation of this should involve having `--strict` warn about the use of normal `return` statements.

I think the danger of this is that it makes assignment functions much less clear in terms of what they're returning—if you want to return something from a nested block,...