[New-bugs-announce] [issue18436] Add mapping of symbol to function to operator module

Zachary Ware report at bugs.python.org
Fri Jul 12 22:46:46 CEST 2013


New submission from Zachary Ware:

In a thread on python-ideas[1], Nick mentioned the idea of ``operator.by_symbol['+=']`` which would be an alternative method of getting the operator.iadd function.  The idea struck my fancy, so I implemented it (regardless of the very real possibility of being rejected anyway, judging by the current split vote in the thread :)).  

I also implemented Brett's suggestion of supporting '.attribute' and '[item]' as well.

Here's the (still a bit rough) patch.

[1] http://mail.python.org/pipermail/python-ideas/2013-July/022078.html

----------
components: Library (Lib)
files: operator-symbol-map.diff
keywords: patch
messages: 192970
nosy: barry, belopolsky, brett.cannon, ncoghlan, serhiy.storchaka, zach.ware
priority: normal
severity: normal
status: open
title: Add mapping of symbol to function to operator module
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file30906/operator-symbol-map.diff

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


More information about the New-bugs-announce mailing list