[issue13804] Python library structure creates hard to read code when using higher order functions

Terry J. Reedy report at bugs.python.org
Sat Jan 21 04:10:55 CET 2012


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I am closing this because map has even less chance of being made a collection method than join. Unlike join, map takes any positive number of iterables as args, not just one. 'Iterables' includes iterators, which intentionally need have no methods other than __iter__ and __next__.

If map were an attribute, it should be an attribute of 'function' (except that there is no one function class).

To abstract attributes, use get/setattr. Untested example: 

def atcat(self, src,  src_at, dst):
  res = []
  for col in getattr(self, src):
    res += getattr(col, src_at)
  setattr(self, dst, res)

----------
nosy: +terry.reedy
resolution:  -> rejected
status: open -> closed
versions: +Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13804>
_______________________________________


More information about the Python-bugs-list mailing list