[Python-Dev] Reserve ':=' for type-inferred variable initialization (was PEP 572) (original) (raw)
Steven D'Aprano steve at pearwood.info
Sat Apr 28 06:44:45 EDT 2018
- Previous message (by thread): [Python-Dev] Reserve ':=' for type-inferred variable initialization (was PEP 572)
- Next message (by thread): [Python-Dev] Reserve ':=' for type-inferred variable initialization (was PEP 572)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Apr 27, 2018 at 10:56:06PM +1000, Nick Coghlan wrote:
On 27 April 2018 at 22:28, Steven D'Aprano <steve at pearwood.info> wrote:
> On Fri, Apr 27, 2018 at 08:13:20AM +0200, Andrea Griffini wrote: > > Now we got standard library features requiring type annotation > > We do? Did I miss them? Which std lib features are you referring to? > > (That's not a rhetorical question -- maybe I have missed something.) > Data classes rely on the presence of annotations to spot field declarations (it mostly doesn't care what those annotations actually say, but it does need them to be present in order to create the list of field names).
Thanks Nick. But they're not exactly used as type annotations.
It was inevitable that something in the std lib would eventually make use of annotations, but unless they're used for type-checking, that's hardly eating away at the promise "no mandatory static typing".
-- Steve
- Previous message (by thread): [Python-Dev] Reserve ':=' for type-inferred variable initialization (was PEP 572)
- Next message (by thread): [Python-Dev] Reserve ':=' for type-inferred variable initialization (was PEP 572)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]