[issue21237] Update Python 2/3 porting HOWTO's suggestion for dealing with map()

2014-05-09 Thread Brett Cannon

Brett Cannon added the comment:

I never bothered to mention the iter* methods in the HOWTO, and since it 
becomes very obvious very fast to tweak them I'm not going to worry about it 
and add more complexity to the doc.

--
resolution:  - wont fix
status: open - closed

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



[issue21237] Update Python 2/3 porting HOWTO's suggestion for dealing with map()

2014-04-16 Thread Josh Rosenberg

Josh Rosenberg added the comment:

I think the suggestion is intended for how do I keep Python 2 semantics in 
Python 3?, not how can I write my Python 2 code so it will run equivalently 
in Python 3?

It wouldn't be a bad idea to point out that you can adopt Py3 semantics 
initially so as to avoid surprises later on; sadly, unlike a __future__ import, 
if you want cross compatible code you have to do stupid stuff like:

try:
from future_builtins import *
except ImportError:
# Py3 is already the future
pass

--
nosy: +josh.rosenberg

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



[issue21237] Update Python 2/3 porting HOWTO's suggestion for dealing with map()

2014-04-15 Thread Brett Cannon

New submission from Brett Cannon:

In Python 2.6 and newer you can import future_builtins and use everything from 
there. In Python 2.5 it should be itertools.imap(). This is much cleaner than 
the current suggestion at 
https://docs.python.org/2/howto/pyporting.html#update-map-for-imbalanced-input-sequences

--
assignee: brett.cannon
components: Documentation
keywords: easy
messages: 216315
nosy: brett.cannon
priority: normal
severity: normal
stage: needs patch
status: open
title: Update Python 2/3 porting HOWTO's suggestion for dealing with map()
type: enhancement

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