From nicholsonjf at gmail.com Mon Feb 3 00:11:48 2014 From: nicholsonjf at gmail.com (James Nicholson) Date: Sun, 2 Feb 2014 15:11:48 -0800 Subject: [Baypiggies] Higher quality video of Guido's talk Message-ID: Hi everyone, Hector Romero (AV tech) at LinkedIn provided me with their high quality video from Guido's talk. I uploaded it to the BayPiggies YouTube channel here: http://youtu.be/aurOB4qYuFM The Hangout On Air worked very well for live broadcasting (and will definitely work for filming and live broadcasting our future speakers). However, the audio and video quality of LinkedIn's video is much higher so I recommend watching and sharing that version. Big thanks to Glen Jarvis for helping to design and produce the HOA, to Rachel Sanders for letting me onsite a couple days early for a dry run, and to Hector Romero for filming and providing us a copy of their video. James Nicholson nicholsonjf.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at python.org Mon Feb 3 17:00:18 2014 From: brian at python.org (Brian Curtin) Date: Mon, 03 Feb 2014 16:00:18 -0000 Subject: [Baypiggies] PyCon 2014 Call for Proposals, New Website Message-ID: Hi BayPIGgies! PyCon 2014, taking place April 9-17 in Montreal, has just passed 1600 tickets sold, and we're seeing sales ramp up very quickly. Late last week we were announcing the 1500 mark, and with a cap of 2000 tickets, we expect these last four hundred to move quickly. Head to https://us.pycon.org/2014/registration/ to buy yours today! This year's talk schedule is available at https://us.pycon.org/2014/schedule/talks/, along with a keynote series including EFF co-founder John Perry Barlow; IPython creator, Fernando Perez; PSF director, Jessica McKellar; PSF chairman, Van Lindberg; and Python's creator, Guido van Rossum. The tutorial schedule is available at https://us.pycon.org/2014/schedule/tutorials/, and spaces are limited! You'd be hard pressed to find a better value than our tutorials. We've long thought PyCon to be family friendly, and last year's aYoung Codera tutorials were a hugely successful step towards showing it. The tutorials are back again this year, with registration opening shortly for children 12 and over: https://us.pycon.org/2014/events/letslearnpython/. For kids under 12, we're pleased to be offering childcare! See https://us.pycon.org/2014/childcare/ for details. The 5K Charity Fun Run is on its third year, with proceeds benefiting the EFF. It's a fun time and supports a good cause. For the 5K and many other events, check out the Events section on https://us.pycon.org/2014/ Make sure your passport is in order, as you need one to cross the border. More details available here: http://pycon.blogspot.com/2014/01/pycon-attendees-from-us-you-need.html For the latest updates, follow us on Twitter at https://twitter.com/pycon, and on our blog at http://pycon.blogspot.com/ Hope to see you in Montreal! Diana Clarke, Chair diana.joan.clarke at gmail.com Brian Curtin, Publicity Coordinator brian at python.org From brian at python.org Mon Feb 3 17:05:09 2014 From: brian at python.org (Brian Curtin) Date: Mon, 03 Feb 2014 16:05:09 -0000 Subject: [Baypiggies] PyCon 2014 - 400 tickets remain! Message-ID: Hi BayPIGgies! [I apologize for a second email - this got sent with an old and out-of-date subject line.] PyCon 2014, taking place April 9-17 in Montreal, has just passed 1600 tickets sold, and we're seeing sales ramp up very quickly. Late last week we were announcing the 1500 mark, and with a cap of 2000 tickets, we expect these last four hundred to move quickly. Head to https://us.pycon.org/2014/registration/ to buy yours today! This year's talk schedule is available at https://us.pycon.org/2014/schedule/talks/, along with a keynote series including EFF co-founder John Perry Barlow; IPython creator, Fernando Perez; PSF director, Jessica McKellar; PSF chairman, Van Lindberg; and Python's creator, Guido van Rossum. The tutorial schedule is available at https://us.pycon.org/2014/schedule/tutorials/, and spaces are limited! You'd be hard pressed to find a better value than our tutorials. We've long thought PyCon to be family friendly, and last year's aYoung Codera tutorials were a hugely successful step towards showing it. The tutorials are back again this year, with registration opening shortly for children 12 and over: https://us.pycon.org/2014/events/letslearnpython/. For kids under 12, we're pleased to be offering childcare! See https://us.pycon.org/2014/childcare/ for details. The 5K Charity Fun Run is on its third year, with proceeds benefiting the EFF. It's a fun time and supports a good cause. For the 5K and many other events, check out the Events section on https://us.pycon.org/2014/ Make sure your passport is in order, as you need one to cross the border. More details available here: http://pycon.blogspot.com/2014/01/pycon-attendees-from-us-you-need.html For the latest updates, follow us on Twitter at https://twitter.com/pycon, and on our blog at http://pycon.blogspot.com/ Hope to see you in Montreal! Diana Clarke, Chair diana.joan.clarke at gmail.com Brian Curtin, Publicity Coordinator brian at python.org From jjinux at gmail.com Tue Feb 11 01:36:52 2014 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Mon, 10 Feb 2014 16:36:52 -0800 Subject: [Baypiggies] Twitter is looking for experienced tools and automation engineers to join our Data Center Tools Team Message-ID: Twitter is looking for experienced tools and automation engineers to join our Data Center Tools Team. You have experience designing and implementing tools to visualize and automate processes. You enjoy complex automation challenges and building tools from start to finish. *Responsibilities: * Design and develop tools to automate workflows as well as access, process, and visualize data. Create and manage automation project schedules with the team. Build Design and Training Documentation required for each automation project. Identify potential issues, and work with engineering, and operations to design elegant, and efficient solutions. Perform code reviews, evaluate implementations, and provide feedback about potential tool improvements. *Requirements: * Expert experience in one or more programming languages: *Python*(preferred), Javascript, Bash Comfortable with various web client technologies: AJAX, CORS, CSS, D3, Flask, Django, Angular, jQuery Experience writing Restful Web Services and client APIs Comfortable with Revision Control Systems: Git, Subversion Familiar with one or more Database and SQL dialects: MySQL, Oracle, Postgres, SQLite, Redis, HBase 3+ years experience in software engineering BS/MS in CompScience and/or equivalent related experience *Soft Skills * Excellent written/communication skills, and the ability to work effectively across multiple teams. A strong work ethic, the ability to keep complex tasks organized, and an amazing attention to detail. Ability to prioritize tasks and work independently. Bonus: Use of or commits to open source projects. Active user of Twitter. If you're interested, send me your resume. To see other jobs at Twitter, see https://twitter.com/jobs. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simeonf at gmail.com Fri Feb 14 19:34:03 2014 From: simeonf at gmail.com (Simeon Franklin) Date: Fri, 14 Feb 2014 10:34:03 -0800 Subject: [Baypiggies] Upcoming PyCon Startup Evening @ Twitter Message-ID: Hey All - If you or a Pythonista you know is interested in pitching their startup and winning a free booth on Startup Row @ Pycon 2014 please read on. Actually - if you just want to come and hang out with Pythonistas at Twitter next Wednesday night (food and beverages provided) you might read on too. Twitter is hosting a Python Startup Evening Feb 19th at 6pm. Please see the eventbrite page for full details ( http://www.eventbrite.com/e/pycon-startup-evening-twitter-tickets-10604697937). The event is free and open to all but we are looking especially for Startups who use Python and are interested in presenting. See the eventbrite page to sign up to pitch - you will have 5 minutes to persuade the audience and a panel of judges that your startup best deserves to their support. The best pitch will be awarded a free booth at PyCon 2014 in Montreal! It should be a fun night and I hope a knowledgeable Python audience as well as interesting Python startups come on out! -regards Simeon -------------- next part -------------- An HTML attachment was scrubbed... URL: From sangeeth.saravanaraj at gmail.com Tue Feb 25 01:49:51 2014 From: sangeeth.saravanaraj at gmail.com (Sangeeth Saravanaraj) Date: Tue, 25 Feb 2014 06:19:51 +0530 Subject: [Baypiggies] Class decorator to capture the creation and deletion of objects Message-ID: This question was initially asked in tutor at python.org; Now I am widening the audience to gain attention. I want to create a decorator which should do the following things: => When an object of the decorated class is created, the objects name (say the value of the incoming "id" argument) should be stored as a record in a table in a database. => When an object of the decorated class is deleted, the record with this deleted objects name (i.e. object.id) should be removed from the table. Now, for example - consider the following snippet: @saveme class A(object): def __init__(self, id): self.id = id @saveme class B(object): def __init__(self, id): self.id = id "saveme" should do what I have explained earlier. a1 = A("A1") a2 = A("A2") a3 = A("A3") b1 = B("B1") b2 = B("B2") At this point if I query and print all the records in a table, I should get the following output: ["A1", "A2", "A3", "B1", "B2"] del a1 del a2 del a3 del b1 del b2 At this point, all entries in the table should be deleted; query should return an empty list! And, I want to highlight that the classes that are being decorated with "saveme" can de derived classes too [which initialises its base classes using super() method]! Now the following is what I have tried: class saveme(object): def __init__(self, klass): print "saveme::__init__()" self._klass = klass def __call__(self, *args, **kwargs): print "saveme::__call__()" obj = self._klass(*args, **kwargs) # creation of DB record will happen here! # i.e. something like add_to_db(kwargs.get("id")) return obj def __del__(self): # deletion of DB record will happen here! # i.e. something like remove_from_db(id) # TODO: how to retrieve the "id" here?! print "saveme::__del__()" class Parent1(object): def __init__(self): print "Parent1:: __init__()" super(Parent1, self).__init__() class Parent2(object): def __init__(self): print "Parent2:: __init__()" super(Parent2, self).__init__() @saveme class A(Parent1, Parent2): def __init__(self, id): print "A::__init__()" self.id = id #super(A, self).__init__() #@saveme #class B(object): # def __init__(self, id): # print "B::__init__()" # self.id = id def main(): a1 = A(id="A1") # b1 = B(id="B1") if __name__ == "__main__": main() When executed the above, I ran in to the following: saveme::__init__() saveme::__call__() A::__init__() Traceback (most recent call last): File "1.py", line 54, in main() File "1.py", line 50, in main a1 = A(id="A1") File "1.py", line 10, in __call__ obj = self._klass(*args, **kwargs) File "1.py", line 39, in __init__ super(A, self).__init__() TypeError: must be type, not saveme saveme::__del__() When I commented "super(A, self).__init__()" in the class A :: __init__() method, it returned an object of type A and I was able to see the prints in the __call__ and __del__ methods but the __init__() methods of the base classes (Parent1 & Parent2) were not called! >From the error message, what I could understand is - the object returned by saveme::__call__() is not of type A but of type saveme. But when I put a print in the saveme::__call__() I could see it returns an object of type A and not saveme. Now the question is - with this approach to capture the initiation and deletion events of an object, how do I initialise the base classes using super()? Or, is there any other better way to capture the __call__ and __del__ events for an object of a certain class - if so, how?! Thank you, Sangeeth PS: http://stackoverflow.com/questions/21826854/typeerror-when-using-super-method-with-class-decorator-for-a-derived-class -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleax at google.com Tue Feb 25 03:24:52 2014 From: aleax at google.com (Alex Martelli) Date: Mon, 24 Feb 2014 18:24:52 -0800 Subject: [Baypiggies] Class decorator to capture the creation and deletion of objects In-Reply-To: References: Message-ID: Off the cuff, I'd make saveme into a function, not a class; the saveme function would alter the class passed in as its only argument (saving __init__ and/or __del__ methods it may have and replacing them with other -- nested -- functions that call them and do the rest of the job) and return the same class object it received. No time to actually write the code but this seems a much sounder architecture. Alex On Mon, Feb 24, 2014 at 4:49 PM, Sangeeth Saravanaraj < sangeeth.saravanaraj at gmail.com> wrote: > This question was initially asked in tutor at python.org; Now I am widening > the audience to gain attention. > > I want to create a decorator which should do the following things: > => When an object of the decorated class is created, the objects name > (say the value of the incoming "id" argument) should be stored as a record > in a table in a database. > => When an object of the decorated class is deleted, the record with this > deleted objects name (i.e. object.id) should be removed from the table. > > Now, for example - consider the following snippet: > > @saveme > class A(object): > def __init__(self, id): > self.id = id > > @saveme > class B(object): > def __init__(self, id): > self.id = id > > "saveme" should do what I have explained earlier. > > a1 = A("A1") > a2 = A("A2") > a3 = A("A3") > b1 = B("B1") > b2 = B("B2") > > At this point if I query and print all the records in a table, I should > get the following output: > ["A1", "A2", "A3", "B1", "B2"] > > del a1 > del a2 > del a3 > del b1 > del b2 > > At this point, all entries in the table should be deleted; query should > return an empty list! > > And, I want to highlight that the classes that are being decorated with > "saveme" can de derived classes too [which initialises its base classes > using super() method]! > > Now the following is what I have tried: > > class saveme(object): > def __init__(self, klass): > print "saveme::__init__()" > self._klass = klass > > def __call__(self, *args, **kwargs): > print "saveme::__call__()" > obj = self._klass(*args, **kwargs) > # creation of DB record will happen here! > # i.e. something like add_to_db(kwargs.get("id")) > return obj > > def __del__(self): > # deletion of DB record will happen here! > # i.e. something like remove_from_db(id) > # TODO: how to retrieve the "id" here?! > print "saveme::__del__()" > > > class Parent1(object): > def __init__(self): > print "Parent1:: __init__()" > super(Parent1, self).__init__() > > > class Parent2(object): > def __init__(self): > print "Parent2:: __init__()" > super(Parent2, self).__init__() > > > @saveme > class A(Parent1, Parent2): > def __init__(self, id): > print "A::__init__()" > self.id = id > #super(A, self).__init__() > > > #@saveme > #class B(object): > # def __init__(self, id): > # print "B::__init__()" > # self.id = id > > > def main(): > a1 = A(id="A1") > # b1 = B(id="B1") > > if __name__ == "__main__": > main() > > > When executed the above, I ran in to the following: > > saveme::__init__() > saveme::__call__() > A::__init__() > Traceback (most recent call last): > File "1.py", line 54, in > main() > File "1.py", line 50, in main > a1 = A(id="A1") > File "1.py", line 10, in __call__ > obj = self._klass(*args, **kwargs) > File "1.py", line 39, in __init__ > super(A, self).__init__() > TypeError: must be type, not saveme > saveme::__del__() > > > When I commented "super(A, self).__init__()" in the class A :: __init__() > method, it returned an object of type A and I was able to see the prints in > the __call__ and __del__ methods but the __init__() methods of the base > classes (Parent1 & Parent2) were not called! > > From the error message, what I could understand is - the object returned > by saveme::__call__() is not of type A but of type saveme. But when I put a > print in the saveme::__call__() I could see it returns an object of type A > and not saveme. > > Now the question is - with this approach to capture the initiation and > deletion events of an object, how do I initialise the base classes using > super()? > > Or, is there any other better way to capture the __call__ and __del__ > events for an object of a certain class - if so, how?! > > Thank you, > > Sangeeth > > > PS: > http://stackoverflow.com/questions/21826854/typeerror-when-using-super-method-with-class-decorator-for-a-derived-class > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at bitcasa.com Tue Feb 25 04:46:07 2014 From: david at bitcasa.com (David Lawrence) Date: Mon, 24 Feb 2014 19:46:07 -0800 Subject: [Baypiggies] Class decorator to capture the creation and deletion of objects In-Reply-To: References: Message-ID: If as according to the docs, there is no guarantee of __del__ being called, anything that relies on that seems unsafe (depending on how robust one needs the solutions to be). Solutions I've seen elsewhere suggest creating something like a *release()* method on your objects and calling it explicitly before calling *del my_obj *(if you even call del, rather than just relying on GC). Alternatively, if it suits the scenario, use a context manager. All suggestions lifted from (a SO that informed me in the past): http://stackoverflow.com/questions/6104535/i-dont-understand-this-python-del-behaviour On Mon, Feb 24, 2014 at 6:24 PM, Alex Martelli wrote: > Off the cuff, I'd make saveme into a function, not a class; > the saveme function would alter the class passed in as its only argument > (saving __init__ and/or __del__ methods it may have and replacing them with > other -- nested -- functions that call them and do the rest of the job) and > return the same class object it received. > > No time to actually write the code but this seems a much sounder > architecture. > > > Alex > > > > On Mon, Feb 24, 2014 at 4:49 PM, Sangeeth Saravanaraj < > sangeeth.saravanaraj at gmail.com> wrote: > >> This question was initially asked in tutor at python.org; Now I am widening >> the audience to gain attention. >> >> I want to create a decorator which should do the following things: >> => When an object of the decorated class is created, the objects name >> (say the value of the incoming "id" argument) should be stored as a record >> in a table in a database. >> => When an object of the decorated class is deleted, the record with >> this deleted objects name (i.e. object.id) should be removed from the >> table. >> >> Now, for example - consider the following snippet: >> >> @saveme >> class A(object): >> def __init__(self, id): >> self.id = id >> >> @saveme >> class B(object): >> def __init__(self, id): >> self.id = id >> >> "saveme" should do what I have explained earlier. >> >> a1 = A("A1") >> a2 = A("A2") >> a3 = A("A3") >> b1 = B("B1") >> b2 = B("B2") >> >> At this point if I query and print all the records in a table, I should >> get the following output: >> ["A1", "A2", "A3", "B1", "B2"] >> >> del a1 >> del a2 >> del a3 >> del b1 >> del b2 >> >> At this point, all entries in the table should be deleted; query should >> return an empty list! >> >> And, I want to highlight that the classes that are being decorated with >> "saveme" can de derived classes too [which initialises its base classes >> using super() method]! >> >> Now the following is what I have tried: >> >> class saveme(object): >> def __init__(self, klass): >> print "saveme::__init__()" >> self._klass = klass >> >> def __call__(self, *args, **kwargs): >> print "saveme::__call__()" >> obj = self._klass(*args, **kwargs) >> # creation of DB record will happen here! >> # i.e. something like add_to_db(kwargs.get("id")) >> return obj >> >> def __del__(self): >> # deletion of DB record will happen here! >> # i.e. something like remove_from_db(id) >> # TODO: how to retrieve the "id" here?! >> print "saveme::__del__()" >> >> >> class Parent1(object): >> def __init__(self): >> print "Parent1:: __init__()" >> super(Parent1, self).__init__() >> >> >> class Parent2(object): >> def __init__(self): >> print "Parent2:: __init__()" >> super(Parent2, self).__init__() >> >> >> @saveme >> class A(Parent1, Parent2): >> def __init__(self, id): >> print "A::__init__()" >> self.id = id >> #super(A, self).__init__() >> >> >> #@saveme >> #class B(object): >> # def __init__(self, id): >> # print "B::__init__()" >> # self.id = id >> >> >> def main(): >> a1 = A(id="A1") >> # b1 = B(id="B1") >> >> if __name__ == "__main__": >> main() >> >> >> When executed the above, I ran in to the following: >> >> saveme::__init__() >> saveme::__call__() >> A::__init__() >> Traceback (most recent call last): >> File "1.py", line 54, in >> main() >> File "1.py", line 50, in main >> a1 = A(id="A1") >> File "1.py", line 10, in __call__ >> obj = self._klass(*args, **kwargs) >> File "1.py", line 39, in __init__ >> super(A, self).__init__() >> TypeError: must be type, not saveme >> saveme::__del__() >> >> >> When I commented "super(A, self).__init__()" in the class A :: __init__() >> method, it returned an object of type A and I was able to see the prints in >> the __call__ and __del__ methods but the __init__() methods of the base >> classes (Parent1 & Parent2) were not called! >> >> From the error message, what I could understand is - the object returned >> by saveme::__call__() is not of type A but of type saveme. But when I put a >> print in the saveme::__call__() I could see it returns an object of type A >> and not saveme. >> >> Now the question is - with this approach to capture the initiation and >> deletion events of an object, how do I initialise the base classes using >> super()? >> >> Or, is there any other better way to capture the __call__ and __del__ >> events for an object of a certain class - if so, how?! >> >> Thank you, >> >> Sangeeth >> >> >> PS: >> http://stackoverflow.com/questions/21826854/typeerror-when-using-super-method-with-class-decorator-for-a-derived-class >> >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shakefu at gmail.com Tue Feb 25 05:55:32 2014 From: shakefu at gmail.com (Jacob Alheid) Date: Mon, 24 Feb 2014 20:55:32 -0800 (PST) Subject: [Baypiggies] Class decorator to capture the creation and deletion of objects In-Reply-To: References: Message-ID: <1393304131851.7914595c@Nodemailer> ? Sent from Mailbox for iPad On Mon, Feb 24, 2014 at 8:49 PM, David Lawrence wrote: > If as according to the docs, there is no guarantee of __del__ being called, > anything that relies on that seems unsafe (depending on how robust one > needs the solutions to be). Solutions I've seen elsewhere suggest creating > something like a *release()* method on your objects and calling it > explicitly before calling *del my_obj *(if you even call del, rather than > just relying on GC). > Alternatively, if it suits the scenario, use a context manager. > All suggestions lifted from (a SO that informed me in the past): > http://stackoverflow.com/questions/6104535/i-dont-understand-this-python-del-behaviour > On Mon, Feb 24, 2014 at 6:24 PM, Alex Martelli wrote: >> Off the cuff, I'd make saveme into a function, not a class; >> the saveme function would alter the class passed in as its only argument >> (saving __init__ and/or __del__ methods it may have and replacing them with >> other -- nested -- functions that call them and do the rest of the job) and >> return the same class object it received. >> >> No time to actually write the code but this seems a much sounder >> architecture. >> >> >> Alex >> >> >> >> On Mon, Feb 24, 2014 at 4:49 PM, Sangeeth Saravanaraj < >> sangeeth.saravanaraj at gmail.com> wrote: >> >>> This question was initially asked in tutor at python.org; Now I am widening >>> the audience to gain attention. >>> >>> I want to create a decorator which should do the following things: >>> => When an object of the decorated class is created, the objects name >>> (say the value of the incoming "id" argument) should be stored as a record >>> in a table in a database. >>> => When an object of the decorated class is deleted, the record with >>> this deleted objects name (i.e. object.id) should be removed from the >>> table. >>> >>> Now, for example - consider the following snippet: >>> >>> @saveme >>> class A(object): >>> def __init__(self, id): >>> self.id = id >>> >>> @saveme >>> class B(object): >>> def __init__(self, id): >>> self.id = id >>> >>> "saveme" should do what I have explained earlier. >>> >>> a1 = A("A1") >>> a2 = A("A2") >>> a3 = A("A3") >>> b1 = B("B1") >>> b2 = B("B2") >>> >>> At this point if I query and print all the records in a table, I should >>> get the following output: >>> ["A1", "A2", "A3", "B1", "B2"] >>> >>> del a1 >>> del a2 >>> del a3 >>> del b1 >>> del b2 >>> >>> At this point, all entries in the table should be deleted; query should >>> return an empty list! >>> >>> And, I want to highlight that the classes that are being decorated with >>> "saveme" can de derived classes too [which initialises its base classes >>> using super() method]! >>> >>> Now the following is what I have tried: >>> >>> class saveme(object): >>> def __init__(self, klass): >>> print "saveme::__init__()" >>> self._klass = klass >>> >>> def __call__(self, *args, **kwargs): >>> print "saveme::__call__()" >>> obj = self._klass(*args, **kwargs) >>> # creation of DB record will happen here! >>> # i.e. something like add_to_db(kwargs.get("id")) >>> return obj >>> >>> def __del__(self): >>> # deletion of DB record will happen here! >>> # i.e. something like remove_from_db(id) >>> # TODO: how to retrieve the "id" here?! >>> print "saveme::__del__()" >>> >>> >>> class Parent1(object): >>> def __init__(self): >>> print "Parent1:: __init__()" >>> super(Parent1, self).__init__() >>> >>> >>> class Parent2(object): >>> def __init__(self): >>> print "Parent2:: __init__()" >>> super(Parent2, self).__init__() >>> >>> >>> @saveme >>> class A(Parent1, Parent2): >>> def __init__(self, id): >>> print "A::__init__()" >>> self.id = id >>> #super(A, self).__init__() >>> >>> >>> #@saveme >>> #class B(object): >>> # def __init__(self, id): >>> # print "B::__init__()" >>> # self.id = id >>> >>> >>> def main(): >>> a1 = A(id="A1") >>> # b1 = B(id="B1") >>> >>> if __name__ == "__main__": >>> main() >>> >>> >>> When executed the above, I ran in to the following: >>> >>> saveme::__init__() >>> saveme::__call__() >>> A::__init__() >>> Traceback (most recent call last): >>> File "1.py", line 54, in >>> main() >>> File "1.py", line 50, in main >>> a1 = A(id="A1") >>> File "1.py", line 10, in __call__ >>> obj = self._klass(*args, **kwargs) >>> File "1.py", line 39, in __init__ >>> super(A, self).__init__() >>> TypeError: must be type, not saveme >>> saveme::__del__() >>> >>> >>> When I commented "super(A, self).__init__()" in the class A :: __init__() >>> method, it returned an object of type A and I was able to see the prints in >>> the __call__ and __del__ methods but the __init__() methods of the base >>> classes (Parent1 & Parent2) were not called! >>> >>> From the error message, what I could understand is - the object returned >>> by saveme::__call__() is not of type A but of type saveme. But when I put a >>> print in the saveme::__call__() I could see it returns an object of type A >>> and not saveme. >>> >>> Now the question is - with this approach to capture the initiation and >>> deletion events of an object, how do I initialise the base classes using >>> super()? >>> >>> Or, is there any other better way to capture the __call__ and __del__ >>> events for an object of a certain class - if so, how?! >>> >>> Thank you, >>> >>> Sangeeth >>> >>> >>> PS: >>> http://stackoverflow.com/questions/21826854/typeerror-when-using-super-method-with-class-decorator-for-a-derived-class >>> >>> >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> https://mail.python.org/mailman/listinfo/baypiggies >>> >> >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleax at google.com Tue Feb 25 18:44:08 2014 From: aleax at google.com (Alex Martelli) Date: Tue, 25 Feb 2014 09:44:08 -0800 Subject: [Baypiggies] Class decorator to capture the creation and deletion of objects In-Reply-To: References: Message-ID: The best way to avoid relying on __del__ in this particular case may be to hold, rather than a plain list of the IDs, a list of weak references to instances. When the "list of IDs" is asked for, it goes through a property that cleans up those weak refs that correspond to now-disappeared instances, before returning the requested list of IDs. Now __del__ can usefully be removed (as its existence may interfere with GC of cyclical garbage), yet the list of IDs is guaranteed to return the list of still-existing instances' IDs, no matter what constructs or idioms have been used to create and remove instances. This avoid relying on creators/destroyers of instances properly calling release and/or using the appropriate context manager; such reliance is sometimes inevitable, but for this particular spec it does not appear to be, thus, it might best be avoided. Alex On Mon, Feb 24, 2014 at 7:46 PM, David Lawrence wrote: > If as according to the docs, there is no guarantee of __del__ being > called, anything that relies on that seems unsafe (depending on how robust > one needs the solutions to be). Solutions I've seen elsewhere suggest > creating something like a *release()* method on your objects and calling > it explicitly before calling *del my_obj *(if you even call del, rather > than just relying on GC). > > Alternatively, if it suits the scenario, use a context manager. > > All suggestions lifted from (a SO that informed me in the past): > http://stackoverflow.com/questions/6104535/i-dont-understand-this-python-del-behaviour > > > On Mon, Feb 24, 2014 at 6:24 PM, Alex Martelli wrote: > >> Off the cuff, I'd make saveme into a function, not a class; >> the saveme function would alter the class passed in as its only argument >> (saving __init__ and/or __del__ methods it may have and replacing them with >> other -- nested -- functions that call them and do the rest of the job) and >> return the same class object it received. >> >> No time to actually write the code but this seems a much sounder >> architecture. >> >> >> Alex >> >> >> >> On Mon, Feb 24, 2014 at 4:49 PM, Sangeeth Saravanaraj < >> sangeeth.saravanaraj at gmail.com> wrote: >> >>> This question was initially asked in tutor at python.org; Now I am >>> widening the audience to gain attention. >>> >>> I want to create a decorator which should do the following things: >>> => When an object of the decorated class is created, the objects name >>> (say the value of the incoming "id" argument) should be stored as a record >>> in a table in a database. >>> => When an object of the decorated class is deleted, the record with >>> this deleted objects name (i.e. object.id) should be removed from the >>> table. >>> >>> Now, for example - consider the following snippet: >>> >>> @saveme >>> class A(object): >>> def __init__(self, id): >>> self.id = id >>> >>> @saveme >>> class B(object): >>> def __init__(self, id): >>> self.id = id >>> >>> "saveme" should do what I have explained earlier. >>> >>> a1 = A("A1") >>> a2 = A("A2") >>> a3 = A("A3") >>> b1 = B("B1") >>> b2 = B("B2") >>> >>> At this point if I query and print all the records in a table, I should >>> get the following output: >>> ["A1", "A2", "A3", "B1", "B2"] >>> >>> del a1 >>> del a2 >>> del a3 >>> del b1 >>> del b2 >>> >>> At this point, all entries in the table should be deleted; query should >>> return an empty list! >>> >>> And, I want to highlight that the classes that are being decorated with >>> "saveme" can de derived classes too [which initialises its base classes >>> using super() method]! >>> >>> Now the following is what I have tried: >>> >>> class saveme(object): >>> def __init__(self, klass): >>> print "saveme::__init__()" >>> self._klass = klass >>> >>> def __call__(self, *args, **kwargs): >>> print "saveme::__call__()" >>> obj = self._klass(*args, **kwargs) >>> # creation of DB record will happen here! >>> # i.e. something like add_to_db(kwargs.get("id")) >>> return obj >>> >>> def __del__(self): >>> # deletion of DB record will happen here! >>> # i.e. something like remove_from_db(id) >>> # TODO: how to retrieve the "id" here?! >>> print "saveme::__del__()" >>> >>> >>> class Parent1(object): >>> def __init__(self): >>> print "Parent1:: __init__()" >>> super(Parent1, self).__init__() >>> >>> >>> class Parent2(object): >>> def __init__(self): >>> print "Parent2:: __init__()" >>> super(Parent2, self).__init__() >>> >>> >>> @saveme >>> class A(Parent1, Parent2): >>> def __init__(self, id): >>> print "A::__init__()" >>> self.id = id >>> #super(A, self).__init__() >>> >>> >>> #@saveme >>> #class B(object): >>> # def __init__(self, id): >>> # print "B::__init__()" >>> # self.id = id >>> >>> >>> def main(): >>> a1 = A(id="A1") >>> # b1 = B(id="B1") >>> >>> if __name__ == "__main__": >>> main() >>> >>> >>> When executed the above, I ran in to the following: >>> >>> saveme::__init__() >>> saveme::__call__() >>> A::__init__() >>> Traceback (most recent call last): >>> File "1.py", line 54, in >>> main() >>> File "1.py", line 50, in main >>> a1 = A(id="A1") >>> File "1.py", line 10, in __call__ >>> obj = self._klass(*args, **kwargs) >>> File "1.py", line 39, in __init__ >>> super(A, self).__init__() >>> TypeError: must be type, not saveme >>> saveme::__del__() >>> >>> >>> When I commented "super(A, self).__init__()" in the class A :: >>> __init__() method, it returned an object of type A and I was able to see >>> the prints in the __call__ and __del__ methods but the __init__() methods >>> of the base classes (Parent1 & Parent2) were not called! >>> >>> From the error message, what I could understand is - the object returned >>> by saveme::__call__() is not of type A but of type saveme. But when I put a >>> print in the saveme::__call__() I could see it returns an object of type A >>> and not saveme. >>> >>> Now the question is - with this approach to capture the initiation and >>> deletion events of an object, how do I initialise the base classes using >>> super()? >>> >>> Or, is there any other better way to capture the __call__ and __del__ >>> events for an object of a certain class - if so, how?! >>> >>> Thank you, >>> >>> Sangeeth >>> >>> >>> PS: >>> http://stackoverflow.com/questions/21826854/typeerror-when-using-super-method-with-class-decorator-for-a-derived-class >>> >>> >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> https://mail.python.org/mailman/listinfo/baypiggies >>> >> >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Wed Feb 26 05:41:34 2014 From: glen at glenjarvis.com (Glen Jarvis) Date: Tue, 25 Feb 2014 20:41:34 -0800 Subject: [Baypiggies] FYI Website appears down Message-ID: We have a meeting this week. So, I was checking our website and I see that we are having a bad gateway issue: 502 - Bad Gateway The page you requested is currently unavailable. Please try again later. If you are the website owner, please see Error: 502 Bad Gateway documentation for more information and possible steps to resolve the problem. G -- We should be taught not to wait for inspiration to start a thing. Action always generates inspiration. Inspiration seldom generates action. -- Frank Tibolt -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdbaddog at gmail.com Wed Feb 26 05:44:46 2014 From: bdbaddog at gmail.com (William Deegan) Date: Tue, 25 Feb 2014 20:44:46 -0800 Subject: [Baypiggies] FYI Website appears down In-Reply-To: References: Message-ID: Glen, Hosting provider switched our host to new IP. DNS was updated 1:50pm today. I'll check with the webhosting company. -Bill On Tue, Feb 25, 2014 at 8:41 PM, Glen Jarvis wrote: > We have a meeting this week. So, I was checking our website and I see that > we are having a bad gateway issue: > > 502 - Bad Gateway > > The page you requested is currently unavailable. Please try again later. > > If you are the website owner, please see Error: 502 Bad Gateway documentation > for more information and possible steps to resolve the problem. > > G > -- > > We should be taught not to wait for inspiration to start a thing. Action > always generates inspiration. Inspiration seldom generates action. > > -- Frank Tibolt > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdbaddog at gmail.com Wed Feb 26 07:16:48 2014 From: bdbaddog at gmail.com (William Deegan) Date: Tue, 25 Feb 2014 22:16:48 -0800 Subject: [Baypiggies] FYI Website appears down In-Reply-To: References: Message-ID: <8321AC20-16C7-4F87-8496-B939778E416C@gmail.com> Glen, It's back up now. The new server must've been a different OS version or something, had to rebuild plone and restart. -Bill On Feb 25, 2014, at 8:44 PM, William Deegan wrote: > Glen, > > Hosting provider switched our host to new IP. > DNS was updated 1:50pm today. > > I'll check with the webhosting company. > > -Bill > > > > On Tue, Feb 25, 2014 at 8:41 PM, Glen Jarvis wrote: > We have a meeting this week. So, I was checking our website and I see that we are having a bad gateway issue: > > 502 ? Bad Gateway > > The page you requested is currently unavailable. Please try again later. > > If you are the website owner, please see Error: 502 Bad Gateway documentation for more information and possible steps to resolve the problem. > > > G > -- > We should be taught not to wait for inspiration to start a thing. Action always generates inspiration. Inspiration seldom generates action. > > -- Frank Tibolt > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Wed Feb 26 08:02:37 2014 From: glen at glenjarvis.com (Glen Jarvis) Date: Tue, 25 Feb 2014 23:02:37 -0800 Subject: [Baypiggies] FYI Website appears down In-Reply-To: <8321AC20-16C7-4F87-8496-B939778E416C@gmail.com> References: <8321AC20-16C7-4F87-8496-B939778E416C@gmail.com> Message-ID: Awesome! Thank you! :) G On Tue, Feb 25, 2014 at 10:16 PM, William Deegan wrote: > Glen, > > It's back up now. > The new server must've been a different OS version or something, had to > rebuild plone and restart. > > -Bill > On Feb 25, 2014, at 8:44 PM, William Deegan wrote: > > Glen, > > Hosting provider switched our host to new IP. > DNS was updated 1:50pm today. > > I'll check with the webhosting company. > > -Bill > > > > On Tue, Feb 25, 2014 at 8:41 PM, Glen Jarvis wrote: > >> We have a meeting this week. So, I was checking our website and I see >> that we are having a bad gateway issue: >> >> 502 - Bad Gateway >> >> The page you requested is currently unavailable. Please try again later. >> >> If you are the website owner, please see Error: 502 Bad Gateway documentation >> for more information and possible steps to resolve the problem. >> >> G >> -- >> >> We should be taught not to wait for inspiration to start a thing. Action >> always generates inspiration. Inspiration seldom generates action. >> >> -- Frank Tibolt >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > > -- We should be taught not to wait for inspiration to start a thing. Action always generates inspiration. Inspiration seldom generates action. -- Frank Tibolt -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Wed Feb 26 08:57:07 2014 From: glen at glenjarvis.com (Glen Jarvis) Date: Tue, 25 Feb 2014 23:57:07 -0800 Subject: [Baypiggies] See you this Thursday Message-ID: Reminder: http://baypiggies.net/ Main Presentation *Speaker: Paul Orland* Topic: Python Tools for Visual Studio (PTVS) *Abstract:* Python Tools for Visual Studio (PTVS) is a free, open source plugin that turns Visual Studio into a Python IDE. PTVS supports CPython as well as IronPython, and provides IDE features like Intellisense, debugging, and code-browsing for Python applications. Python can be used to create apps for Windows 8.1 and RT, and it is a first-class language for Windows Azure, the Microsoft cloud. In this talk, I will walk through several sample applications and show off some powerful PTVS features. *Speaker: * Paul Orland is co-founder and CTO at Tachyus, building software for the oil and gas industry to optimize energy production. Formerly, he worked on the cloud tools team within Visual Studio at Microsoft, specifically building the IDE extension for browsing data stored in Windows Azure. He worked on the same team as the Python Tools developers, and learned a thing or two from looking over their shoulders. *If you wish to post jobs here, please go to : Job Listings * Meeting ScheduleThe meeting begins @ 7:30PM. The main presentation will start @ 7:40 PM, after the usual announcements. LinkedIn Corporation 2061 (aka Bldg 6)Stierlin Ct Mountain View, CA 94043 Meeting Room: *Neon Carrot* room (subject to change monthly) -- We should be taught not to wait for inspiration to start a thing. Action always generates inspiration. Inspiration seldom generates action. -- Frank Tibolt -------------- next part -------------- An HTML attachment was scrubbed... URL: From wescpy at gmail.com Thu Feb 27 01:30:07 2014 From: wescpy at gmail.com (wesley chun) Date: Wed, 26 Feb 2014 16:30:07 -0800 Subject: [Baypiggies] OT: supporting Python & the PSF with a half/quarter-page ad? Message-ID: Hey everyone, This is somewhat off-topic for this list, but if you've gotten a lot out of Python and want to contribute, the Python Software Foundation is advocating for the language by creating and distributing a brochurethat talks all about the goodness of Python. For the first run, they're making "10,000 copies which the PSF will then distribute to user groups, Python conferences and educational institutions on request and free of charge." If your company is interested in supporting the project and want to advertise in it but find the half-page ad cost prohibitive at EURO 2650 (~$3636) or the 3-line reference ad listing at EURO 500 (~$686) too small, let me know. I'm willing to split the cost of the ad (creating 2 quarter-page ads).. the PSF organizer of the brochure suggested this as an alternative, so now I want to see if any of you or your companies want to participate. The full details can be found here . The deadline is this Fri, Feb 28, so please get back to me by tomorrow privately... thanks! -- Wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "A computer never does what you want... only what you tell it." +wesley chun : wescpy at gmail : @wescpy Python training & consulting : http://CyberwebConsulting.com "Core Python" books : http://CorePython.com Python blog: http://wescpy.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicholsonjf at gmail.com Thu Feb 27 17:51:17 2014 From: nicholsonjf at gmail.com (James Nicholson) Date: Thu, 27 Feb 2014 08:51:17 -0800 Subject: [Baypiggies] Live stream of Python Tools for Visual Studio Message-ID: Hi everyone, Here's the URL where tonight's talk will be live streamed over a Hangout on Air: http://nicholsonjf.com/blog/ptvs I'll also be recording with our video camera, and will post that higher quality video to the BayPiggies YouTube channelafter the talk. See you tonight! James Nicholson nicholsonjf.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin at falatic.com Fri Feb 28 01:03:14 2014 From: martin at falatic.com (Martin Falatic) Date: Thu, 27 Feb 2014 16:03:14 -0800 (PST) Subject: [Baypiggies] See you this Thursday In-Reply-To: References: Message-ID: <26116.24.23.181.240.1393545794.squirrel@martin-wwwss5.ssl.supercp.com> FYI, for anyone unable to connect to Meetup to check on or update RSVPs, they are having an outage today because of a DDoS attack. More info at https://twitter.com/Meetup - Marty On Tue, February 25, 2014 23:57, Glen Jarvis wrote: > Reminder: > > > > http://baypiggies.net/ > > > > Main Presentation > > > > *Speaker: Paul Orland* > Topic: Python Tools for Visual Studio (PTVS) > > > *Abstract:* > Python Tools for Visual Studio (PTVS) is a free, open source plugin that > turns Visual Studio into a Python IDE. PTVS supports CPython as well as > IronPython, and provides IDE features like Intellisense, debugging, and > code-browsing for Python applications. Python can be used to create apps > for Windows 8.1 and RT, and it is a first-class language for Windows > Azure, > the Microsoft cloud. In this talk, I will walk through several sample > applications and show off some powerful PTVS features. > > > > *Speaker: * > Paul Orland is co-founder and CTO at Tachyus, building software for the > oil and gas industry to optimize energy production. Formerly, he worked > on the cloud tools team within Visual Studio at Microsoft, specifically > building the IDE extension for browsing data stored in Windows Azure. He > worked on the same team as the Python Tools developers, and learned a > thing or two from looking over their shoulders. > > > > *If you wish to post jobs here, please go to : Job Listings > * > Meeting ScheduleThe meeting begins @ 7:30PM. > The main presentation will start @ 7:40 PM, after the usual announcements. > > > LinkedIn Corporation > 2061 (aka Bldg 6)Stierlin Ct > Mountain View, CA 94043 > > > Meeting Room: *Neon Carrot* room (subject to change monthly) > > > > -- > > > We should be taught not to wait for inspiration to start a thing. Action > always generates inspiration. Inspiration seldom generates action. > > -- Frank Tibolt > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies From lauren at eventbrite.com Fri Feb 28 06:35:12 2014 From: lauren at eventbrite.com (Lauren Titterud) Date: Thu, 27 Feb 2014 21:35:12 -0800 Subject: [Baypiggies] Job Posting Message-ID: Hello! I would like to request to post one of our career opportunities. The hiring manager is the co-founder of Django and a Director of Engineering at Eventbrite. Please find the job description below: Senior Software Engineer - Architecture At Eventbrite, we are building technology to effortlessly create, manage, discover and attend live events. We are growing rapidly and are looking for outstanding software engineers to help our architecture team build and design for the next generation of our development platform. Eventbrite is looking for an experienced Senior Software Engineer to join our architecture team! The architecture team is responsible for Eventbrite's public API, as well as designing and building core frameworks and services to help Eventbrite scale and improve the agility of our other development teams. Our ideal candidate thrives on finding elegant solutions to complex problems and brings a deep understanding of engineering for the web and building for scale, in terms of traffic, team size and codebase complexity. Eventbrite's primary stack includes Python, Django, Redis, MySQL, Cassandra, HBase, Hive and AWS. If you are an experienced engineer who wants to help take our architecture and engineering to the next level, read on! *You Will:* - Expand and improve Eventbrite's internal Service Oriented Architecture framework - Work with other product teams to design SOA services that can support Eventbrite's continuing growth and enable future feature development - Design and build the next generation of Eventbrite's public API - Evaluate and integrate new technologies into Eventbrite's development platform - Provide coaching and mentorship to other members of Eventbrite's engineering team *You Bring:* - Strong knowledge of several programming languages, including Python. Experience with Django is a bonus - In-depth SQL database experience - In-depth knowledge and experience of Unix-like operating systems - Understanding and basic experience of at least one NoSQL database - 1+ years experience working on a high-volume/high-availability transaction-based website (ideally LAMP-stack) - Knowledge of Service Oriented Architecture concepts - Deep understanding of web protocols and technologies such as HTTP, JSON and XML - Understanding of Web APIs, including OAuth and REST - Experience working with non-technical stakeholders to extract and refine technical requirements and use them to deliver and maintain a working system - Strong written and verbal communication skills - Experience with Test-Driven Development - Working knowledge of front-end technologies (HTML5, CSS, Ajax, JavaScript) - Background in Computer Science preferred To apply, please submit your resume and cover letter through this link: https://hire.jobvite.com/j?cj=oPVoYfwQ&s=BayPiggies Please let me know if there is anything else I need to do to post this job opportunity! Cheers, Lauren -- *Lauren Titterud* *Technical Recruiter* *|* (415) 694-7938 *| *@tweeterud *|* LinkedIn $2B *|* Briteling Blog *| Engineering Blog * *|* A Day in the Life at Eventbrite *|* Welcome to the Briteland! *|* Don't just sit there... -------------- next part -------------- An HTML attachment was scrubbed... URL: