tag:blogger.com,1999:blog-3888382143307542639.post8784272214286759372..comments2023-02-02T03:36:20.483+00:00Comments on Lacking Rhoticity: Introducing CapPythonMark Seabornhttp://www.blogger.com/profile/08046205947658697263noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-3888382143307542639.post-2600956656087678932008-09-20T08:18:00.000+01:002008-09-20T08:18:00.000+01:00(dummy comment because i forgot to check the 'foll...(dummy comment because i forgot to check the 'follow-up' box)Calvin Spealmanhttps://www.blogger.com/profile/07161631946662126734noreply@blogger.comtag:blogger.com,1999:blog-3888382143307542639.post-36056851491561396802008-09-20T08:17:00.000+01:002008-09-20T08:17:00.000+01:00I had a similar project involving both the verific...I had a similar project involving both the verification of pure functions and a bytecode transformer that enforces the behavior. I see similar goals and possible cross pollination. I've been looking to revive the project and release it.Calvin Spealmanhttps://www.blogger.com/profile/07161631946662126734noreply@blogger.comtag:blogger.com,1999:blog-3888382143307542639.post-19326451139752621872008-09-20T01:14:00.000+01:002008-09-20T01:14:00.000+01:00How does encapsulation buy you sandboxing? Am I m...How does encapsulation buy you sandboxing? Am I missing something? I don't see the logical connection between sandboxed/jailed code (with disabled file/os/socket libraries) and having _private members...<BR/><BR/>Is it just a prerequisite for the downstream task of locking out the dangerous calls?<BR/><BR/>Not trying to be argumentative... Just wondering.Anonymoushttps://www.blogger.com/profile/07787752537023885656noreply@blogger.comtag:blogger.com,1999:blog-3888382143307542639.post-1641957193429721482008-09-19T23:07:00.000+01:002008-09-19T23:07:00.000+01:00@Donovan, right, like restricted python in Zope. N...@Donovan, right, like restricted python in Zope. Note: I just *asked* what the use case was, and this is a very good, if ambitious one. ;)Anonymoushttps://www.blogger.com/profile/04987961040938197252noreply@blogger.comtag:blogger.com,1999:blog-3888382143307542639.post-85431750563305148642008-09-19T23:06:00.000+01:002008-09-19T23:06:00.000+01:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/04987961040938197252noreply@blogger.comtag:blogger.com,1999:blog-3888382143307542639.post-20016165087071421652008-09-19T22:25:00.000+01:002008-09-19T22:25:00.000+01:00Run untrusted code in a sandbox?Run untrusted code in a sandbox?Unknownhttps://www.blogger.com/profile/10301663373330814094noreply@blogger.comtag:blogger.com,1999:blog-3888382143307542639.post-79949721938434013782008-09-19T21:38:00.000+01:002008-09-19T21:38:00.000+01:00Commenters that are commenting about protecting pr...Commenters that are commenting about protecting private variables are missing the point -- this isn't about executing trusted code and just assuming it doesn't do anything nasty. This is about executing untrusted code.<BR/><BR/>For example, a website could allow users to write custom Python code which runs on the server and customizes their pages on the site.Donovan Prestonhttps://www.blogger.com/profile/07076057843365973055noreply@blogger.comtag:blogger.com,1999:blog-3888382143307542639.post-31066490978060376452008-09-19T20:01:00.000+01:002008-09-19T20:01:00.000+01:00Do the simplest thing that could possibly work: i....Do the simplest thing that could possibly work: i.e. don't do this.<BR/><BR/>I've trained a number of people on python and those coming from languages like C++, Java, C# struggle with the idea of not having private, protected etc (almost as much as not having 'type safety). I can tell you though, in practice, working with hundreds of thousands of lines of production python code, multiple authors, over the past 8+ years... it's just not that big a deal. Use the naming conventions and move on.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3888382143307542639.post-70479792874007504932008-09-19T19:45:00.000+01:002008-09-19T19:45:00.000+01:00Just out of curiosity: Why are you building this (...Just out of curiosity: Why are you building this (that is meant in the least aggressive/disparaging way possible, I forget the emoticon ;) <BR/><BR/>Is it that you come from another language that has strictly enforced private variables, and wish for this capability in python too, or are you building something that absolutely needs them? Again, I'm not saying there's no use case for this, just wondering what yours is...Anonymoushttps://www.blogger.com/profile/04987961040938197252noreply@blogger.comtag:blogger.com,1999:blog-3888382143307542639.post-58588104172424026362008-09-19T14:10:00.000+01:002008-09-19T14:10:00.000+01:00That is rejected by the verifier.Firstly, "self._p...That is rejected by the verifier.<BR/><BR/>Firstly, "self._private" is rejected, because "self" isn't a self variable here despite its name.<BR/><BR/>Secondly, <A HREF="http://mail.python.org/pipermail/python-dev/2008-September/082482.html" REL="nofollow">the attribute assignment is rejected</A>, because OriginalClass isn't a self variable either.Mark Seabornhttps://www.blogger.com/profile/08046205947658697263noreply@blogger.comtag:blogger.com,1999:blog-3888382143307542639.post-79609077758466666842008-09-18T20:52:00.000+01:002008-09-18T20:52:00.000+01:00How would it handle adding a method to the class t...How would it handle adding a method to the class that exposes private attributes?<BR/><BR/>def naughty(self):<BR/> return self._private<BR/><BR/>OriginalClass.method = naughty<BR/><BR/>instance.method()Michael Foordhttps://www.blogger.com/profile/06229713779852499022noreply@blogger.com