tag:blogger.com,1999:blog-68730239358084672.post2602898153220496114..comments2026-04-13T04:00:41.271-07:00Comments on Technical Discovery: Python Enhancement Proposals I Wish I Had Time to ChampionTravis Oliphanthttp://www.blogger.com/profile/04514536132317233988noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-68730239358084672.post-36336333218233341572017-02-01T23:27:37.807-08:002017-02-01T23:27:37.807-08:00Great insights. I look forward to reading what you...Great insights. I look forward to reading what you're planning on next, because your post is a nice read.<a href="http://www.akaleyehospital.com/cataract/" rel="nofollow"> cataract surgery in india </a>Anonymoushttps://www.blogger.com/profile/15997804323500994696noreply@blogger.comtag:blogger.com,1999:blog-68730239358084672.post-35968988914624759202011-08-17T18:44:47.714-07:002011-08-17T18:44:47.714-07:00Overloading boolean operators sounds like a bad id...Overloading boolean operators sounds like a bad idea. That's what & and | are for.<br /><br />But it would be awesome if you could just overload a < b < c. But I guess there's no reasonable way to do this without really changing the language semantics. Perhaps if there were a straightforward way to tell and and or to not short-circuit.Aaron Meurerhttps://www.blogger.com/profile/07681610358074038422noreply@blogger.comtag:blogger.com,1999:blog-68730239358084672.post-23516965000517504742011-07-06T05:30:28.149-07:002011-07-06T05:30:28.149-07:00Wouldn't it be very hard to disambiguate slice...Wouldn't it be very hard to disambiguate slice notation from dictionary creation?<br /><br />For example, is the following a set of slices or a dictionary?<br /><br /> {1:3, 3:4}<br /><br />I have no opinion on the additional operators, but will take your word for it (and I have no objection). Overloadable boolean operators I would have found useful on occasion.Michael Foordhttps://www.blogger.com/profile/06229713779852499022noreply@blogger.comtag:blogger.com,1999:blog-68730239358084672.post-4335433024967475762011-07-02T15:26:14.641-07:002011-07-02T15:26:14.641-07:00You mean Unicode identifiers :)
I would rather cr...You mean Unicode identifiers :)<br /><br />I would rather create a custom import mechanism that converts operator-enhanced Python (or whatever) to plain Python before importing a module. There would be drawbacks (e.g. inability to use custom operators directly in the standard Python interpreter unless a custome shell is created) and I am not sure whether this is yet/soon-will-be possible (I believe Brett Canon would be the one to ask about this).ΤΖΩΤΖΙΟΥhttps://www.blogger.com/profile/07123532353472970521noreply@blogger.comtag:blogger.com,1999:blog-68730239358084672.post-64882957327127387182011-07-02T12:53:02.670-07:002011-07-02T12:53:02.670-07:00Thanks for the reminder about this idea. I though...Thanks for the reminder about this idea. I thought it was clever when I first saw it proposed. <br /><br />With Python 3's allowing of unicode literals, you might even convince me that using something like this with a special unicode literal (i.e. that looks like a dot) would be acceptable. <br /><br />Hmm... Now, we just need someone to propose an appropriate Unicode character to make a variable out of...Travis Oliphanthttps://www.blogger.com/profile/04514536132317233988noreply@blogger.comtag:blogger.com,1999:blog-68730239358084672.post-22694980674635790052011-07-02T08:37:59.142-07:002011-07-02T08:37:59.142-07:00Yep, found some link: http://groups.google.com/gro...Yep, found some link: http://groups.google.com/group/comp.lang.python/msg/fde158f60015ccc6ΤΖΩΤΖΙΟΥhttps://www.blogger.com/profile/07123532353472970521noreply@blogger.comtag:blogger.com,1999:blog-68730239358084672.post-62193657846346087252011-07-02T08:33:03.494-07:002011-07-02T08:33:03.494-07:00ISTR discussing a module in c.l.py that produced a...ISTR discussing a module in c.l.py that produced a CustomOperator class overloading the __ror__ and __or__ operators; given this (and the necessary “magic” inside the code), you could:<br /><br /> from custom_operator import matmult<br /><br /> a= b |matmult| c<br /><br />matpow being an instance of CustomOperator.<br /><br />If one overloads other special methods as well closer to the real meaning of the custom operator, it's possible to take advantage of operator precedence:<br /><br /> from custom_operator import matmult, matpow<br /><br /> a= b *matmult* c ^matpow^ d<br /><br />A hack, I know :)ΤΖΩΤΖΙΟΥhttps://www.blogger.com/profile/07123532353472970521noreply@blogger.com