[Python-ideas] Re: Improvement: __json__

2020-04-07 Thread Tin Tvrtković
As the author of one of these third-party libraries, I feel like I can contribute to this discussion. It can indeed be done very elegantly with type annotations, and it should for sure be left to the ecosystem. The only things we need from core Python are good tools for dealing with run-time type

Re: [Python-ideas] JavaScript-Style Object Creation in Python (using a constructor function instead of a class to create objects)

2017-05-19 Thread Tin Tvrtković
Hello, I'm an attrs contributor so maybe I can clear up any questions. Convert callables are only called in __init__, not in the setters. We've had this requested a number of times and we will almost certainly support it in the future, probably on an opt-in basis. The reason we don't currently

Re: [Python-ideas] Python-ideas Digest, Vol 126, Issue 35

2017-05-16 Thread Tin Tvrtković
I have it on good authority both Hynek (the author of attrs) and Glyph will be attending PyCon. I think it'd be a shame if they weren't involved with this effort somehow. > Message: 2 > Date: Tue, 16 May 2017 07:53:50 -0700 > From: Guido van Rossum > To: Ivan Levkivskyi

Re: [Python-ideas] Augmented assignment syntax for objects.

2017-04-29 Thread Tin Tvrtković
On Fri, Apr 28, 2017 at 3:07 PM Nick Coghlan wrote: > Yes, the point I attempted to raise earlier: at the language design > level, "How do we make __init__ methods easier to write?" is the > *wrong question* to be asking. It's treating the symptom (writing an > imperative

Re: [Python-ideas] Augmented assignment syntax for objects.

2017-04-28 Thread Tin Tvrtković
I'm gonna take a shot at elaborating this point. We Python programmers often tout Python as a high-level, high-productivity language where complex and useful things are easy to do. However, vanilla Python classes are anything but high level; they're basically glorified dictionaries that require

Re: [Python-ideas] Augmented assignment syntax for objects.

2017-04-25 Thread Tin Tvrtković
You might want to check out attrs (http://attrs.readthedocs.io/en/stable/). It can generate the __init__ for you, and much much more. Date: Tue, 25 Apr 2017 14:33:49 +0200 > From: George Fischhof > To: Paul Moore > Cc: Python-Ideas