[issue42067] Type annotation in for-loops

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

Thanks for your input Mark!

--
components:  -Build
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42067] Type annotation in for-loops

2021-05-04 Thread Mark Shannon


Mark Shannon  added the comment:

Definitely one for Python ideas.
Quite a good idea though.

--
nosy: +Mark.Shannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42067] Type annotation in for-loops

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

@pablo, may I close this issue as 'not a bug'? I think it looks like a feature 
request that belongs on https://discuss.python.org/c/ideas/ or 
https://mail.python.org/mailman3/lists/python-ideas.python.org/ instead. What 
do you think?

--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42067] Type annotation in for-loops

2020-10-18 Thread Ken Jin


Ken Jin  added the comment:

That's an interesting syntax suggestion, you might want to suggest that in the 
python-ideas mailing list for other people to read about it rather than post it 
on python bugs.

IMO, this isn't really an issue since you can specify the type of the elements 
in generic types via::

   my_list: list[int] = [1, 2, 3]
   for element in my_list:
   process(element)

Your type checker should be able to infer that ``element`` is of type ``int`` 
(or hopefully, it will in the near future).

--
nosy: +kj

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42067] Type annotation in for-loops

2020-10-18 Thread barak dopama


New submission from barak dopama :

Why do I have to do this:
for element in my_list:
element: ElementType = element
process(element)
And can't do this:
for element: ElementType  in my_list:
process(element)

--
components: Build
messages: 378859
nosy: gaaartner
priority: normal
severity: normal
status: open
title: Type annotation in for-loops
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com