[issue18436] Add mapping of symbol to function to operator module
Zachary Ware added the comment: With no one (including me) clamoring for this, I'm going to go ahead and reject it. If someone in the future does really want this, I'd be happy to review a new patch. -- resolution: - rejected stage: - resolved status: open - closed versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18436 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18436] Add mapping of symbol to function to operator module
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18436] Add mapping of symbol to function to operator module
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18436] Add mapping of symbol to function to operator module
Serhiy Storchaka added the comment: What is a purpose of this feature? Why you need it? -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18436] Add mapping of symbol to function to operator module
Zachary Ware added the comment: The purpose is to make usage of the operator module more readable, particularly for some of the more exotic operators. For instance, I find ``operator.get_op(=)`` to be a lot more obvious about what's going to happen than ``operator.irshift``. Also, I think it is helpful to have available a listing of all the operators that Python supports. If we're going to have such a listing, why not make it a mapping of op to function? And once we have such a mapping, it would be nice to have a nice interface to it. Having this available would make it easy to implement the kind of function that Nick mentioned in the python-ideas thread, that takes an operator string instead of only a function. I will admit that the need is not great, and obviously this isn't something that someone who needs it couldn't do themselves. But I think the convenience of it makes it at least worth consideration. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18436] Add mapping of symbol to function to operator module
Nick Coghlan added the comment: I liked Ron's suggestion of using it to improve the output of help() (by getting access to the docstrings of the operator functions, and then enhancing those to be a bit more informative) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18436] Add mapping of symbol to function to operator module
Ron Adam added the comment: Regarding opertor.get_op: Look at help(symbols) output for consistancy. There may be items in one that can be included in the other. The operator.get_op addition would be useful for improving help on the symbol information for help/pydoc. Currently it seems overly general for symbols. Also patch, http://bugs.python.org/issue18387, which adds help(symbols) output to pydocs web browser interface. It could use a review. -- nosy: +ron_adam ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18436] Add mapping of symbol to function to operator module
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 rep...@bugs.python.org http://bugs.python.org/issue18436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18436] Add mapping of symbol to function to operator module
Éric Araujo added the comment: Added some comments on Rietveld. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com