From michelle at pdxpython.org Tue Jan 14 20:27:00 2014 From: michelle at pdxpython.org (Michelle Rowley) Date: Tue, 14 Jan 2014 11:27:00 -0800 Subject: [portland] Tonight's meeting CANCELLED, rescheduled for 1/28 Message-ID: Hey all, Just a quick note that tonight's PDX Python meeting has unfortunately had to be pushed back 2 weeks and will now happen on January 28th. More details on Meetup: http://meetu.ps/22rGCl See you in a couple weeks! Michelle Michelle Rowley http://www.michellerowley.com/ Organizer, Portland Python User Group Executive Director, Code Scouts -------------- next part -------------- An HTML attachment was scrubbed... URL: From auraelius at gmail.com Mon Jan 20 19:35:04 2014 From: auraelius at gmail.com (Auraelius) Date: Mon, 20 Jan 2014 10:35:04 -0800 Subject: [portland] This week's Hack + Help session is Tuesday evening 7p at Portland Code School Message-ID: As if your Tuesday night wasn't over-booked already :-) Hack + Help is a place to level up your skills by working on your latest project or by teaching others what you've learned so far. Or, if you like, you can just come by and hang out. Join us at the new, improved, polyglot 2014 Hack + Help sessions! Bring your laptop and desire to learn (and/or teach!). This event was born out of PDX.rb but now regularly has experienced attendees who are willing to help you out with Ruby, JavaScript, Python, HTML/CSS, and more. Hack + Help will be every Tuesday but the first Tuesday of each month, from 7-9pm. This week, Portland Code School is kindly hosting: 1771 NW Pettygrove St. Portland, OR 97209 Call me (Al Zimmerman) at 503.970.3645 if you have any trouble finding us. Here's the Calagator event: http://calagator.org/events/1250465550 Thanks for your time and attention! Al -------------- next part -------------- An HTML attachment was scrubbed... URL: From ethan at stoneleaf.us Mon Jan 20 19:43:54 2014 From: ethan at stoneleaf.us (Ethan Furman) Date: Mon, 20 Jan 2014 10:43:54 -0800 Subject: [portland] This week's Hack + Help session is Tuesday evening 7p at Portland Code School In-Reply-To: References: Message-ID: <52DD6E6A.9090103@stoneleaf.us> On 01/20/2014 10:35 AM, Auraelius wrote: > > Hack + Help will be every Tuesday but the first Tuesday of each month, from > 7-9pm. I think you forgot a word (or maybe even a phrase ;) . -- ~Ethan~ From auraelius at gmail.com Mon Jan 20 20:14:57 2014 From: auraelius at gmail.com (auraelius) Date: Mon, 20 Jan 2014 11:14:57 -0800 Subject: [portland] This week's Hack + Help session is Tuesday evening 7p at Portland Code School In-Reply-To: <52DD6E6A.9090103@stoneleaf.us> References: <52DD6E6A.9090103@stoneleaf.us> Message-ID: Hi, Ethan! Ha ha, yep, I can improve that sentence, that's for sure. I was using 'but' as a preposition (as in with the exception of; except; save: No one replied but me) instead of the more common usage as a conjunction. A bit archaic, tho, for casual conversations. Thanks! Al > On Jan 20, 2014, at 10:43, Ethan Furman wrote: > >> On 01/20/2014 10:35 AM, Auraelius wrote: >> >> Hack + Help will be every Tuesday but the first Tuesday of each month, from >> 7-9pm. > > I think you forgot a word (or maybe even a phrase ;) . > > -- > ~Ethan~ -------------- next part -------------- An HTML attachment was scrubbed... URL: From markgross at thegnar.org Sun Jan 26 21:06:04 2014 From: markgross at thegnar.org (mark gross) Date: Sun, 26 Jan 2014 12:06:04 -0800 Subject: [portland] __gitattrib__ idoms. How often are they used? Message-ID: <20140126200604.GA12890@mgross-Lenovo-Yoga-2-Pro> I was investigating the git-python package this weekend and as I was looking into why the newere version stopped working with a script we have I discovered an idiom I didn't know about before. You can see my notes on it from my blog http://thegnar.org/sync/?p=337 But, I'd like to ask the pdx-python crew about uses of __getattrib__. What other projects (ab)use it? Is it a common idiom to manufacture unbounded numbers callables this way? where is it considered good / bad? Thanks for any insights. --mark From ethan at stoneleaf.us Sun Jan 26 21:16:37 2014 From: ethan at stoneleaf.us (Ethan Furman) Date: Sun, 26 Jan 2014 12:16:37 -0800 Subject: [portland] __gitattrib__ idoms. How often are they used? In-Reply-To: <20140126200604.GA12890@mgross-Lenovo-Yoga-2-Pro> References: <20140126200604.GA12890@mgross-Lenovo-Yoga-2-Pro> Message-ID: <52E56D25.90300@stoneleaf.us> On 01/26/2014 12:06 PM, mark gross wrote: > > But, I'd like to ask the pdx-python crew about uses of __getattrib__. There is no __getattrib__ -- there is a __getattr__ and a __getattribute__; which did you mean? -- ~Etahn~ From markgross at thegnar.org Sun Jan 26 23:04:21 2014 From: markgross at thegnar.org (mark gross) Date: Sun, 26 Jan 2014 14:04:21 -0800 Subject: [portland] __gitattrib__ idoms. How often are they used? In-Reply-To: <52E56D25.90300@stoneleaf.us> References: <20140126200604.GA12890@mgross-Lenovo-Yoga-2-Pro> <52E56D25.90300@stoneleaf.us> Message-ID: <20140126220421.GA14752@mgross-Lenovo-Yoga-2-Pro> On Sun, Jan 26, 2014 at 12:16:37PM -0800, Ethan Furman wrote: > On 01/26/2014 12:06 PM, mark gross wrote: > > > >But, I'd like to ask the pdx-python crew about uses of __getattrib__. > > There is no __getattrib__ -- there is a __getattr__ and a __getattribute__; which did you mean? Sorry for the type-oh. I'm talking about __getattr__ --mark From chiller at decipherinc.com Mon Jan 27 00:18:02 2014 From: chiller at decipherinc.com (Christopher Hiller) Date: Sun, 26 Jan 2014 15:18:02 -0800 Subject: [portland] __gitattrib__ idoms. How often are they used? In-Reply-To: <20140126220421.GA14752@mgross-Lenovo-Yoga-2-Pro> References: <20140126200604.GA12890@mgross-Lenovo-Yoga-2-Pro> <52E56D25.90300@stoneleaf.us> <20140126220421.GA14752@mgross-Lenovo-Yoga-2-Pro> Message-ID: Dunno about whether or not these are "evil" (they are certainly of dubious value), but here's a few use cases: class Foo(dict): """ I am some sort of struct-like object. This will save you at least one keystroke. """ def __getattr__(self, name): try: return self[name] except KeyError: raise AttributeError(name) def __setattr__(self, name, value): self[name] = value class Bar(object): import zlib from codecs import encode """ I like to wrap things! Wrapping things is cool. """ def __init__(self, value): self.value = value def __getattr__(self, name): return zlib.compress(encode('rot13', str(self.value))) class Bar(object): """ """ def __init__(self, stuff): """ :type stuff: dict """ self.stuff = stuff def __getattr__(self, name): try: return Bar(self.stuff[name]) except KeyError: raise AttributeError(name) class Baz(object): """ I namespace my variables because reasons. """ baz_sheep = 'mutton' baz_cow = 'beef' baz_pig = 'pork' def __getattr__(self, name): return getattr(self, 'baz_%s' % name) ? --? Christopher Hiller Decipher, Inc. On January 26, 2014 at 2:04:44 PM, mark gross (markgross at thegnar.org) wrote: On Sun, Jan 26, 2014 at 12:16:37PM -0800, Ethan Furman wrote: > On 01/26/2014 12:06 PM, mark gross wrote: > > > >But, I'd like to ask the pdx-python crew about uses of __getattrib__. > > There is no __getattrib__ -- there is a __getattr__ and a __getattribute__; which did you mean? Sorry for the type-oh. I'm talking about __getattr__ --mark _______________________________________________ Portland mailing list Portland at python.org https://mail.python.org/mailman/listinfo/portland -------------- next part -------------- An HTML attachment was scrubbed... URL: From ethan at stoneleaf.us Sun Jan 26 23:49:41 2014 From: ethan at stoneleaf.us (Ethan Furman) Date: Sun, 26 Jan 2014 14:49:41 -0800 Subject: [portland] __gitattrib__ idoms. How often are they used? In-Reply-To: <20140126220421.GA14752@mgross-Lenovo-Yoga-2-Pro> References: <20140126200604.GA12890@mgross-Lenovo-Yoga-2-Pro> <52E56D25.90300@stoneleaf.us> <20140126220421.GA14752@mgross-Lenovo-Yoga-2-Pro> Message-ID: <52E59105.1090207@stoneleaf.us> On 01/26/2014 02:04 PM, mark gross wrote: > On Sun, Jan 26, 2014 at 12:16:37PM -0800, Ethan Furman wrote: >> On 01/26/2014 12:06 PM, mark gross wrote: >>> >>> But, I'd like to ask the pdx-python crew about uses of __getattrib__. >> >> There is no __getattrib__ -- there is a __getattr__ and a __getattribute__; which did you mean? > > Sorry for the type-oh. I'm talking about __getattr__ Okay, I read your blog entry -- pretty nice! And yes, __getattr__ is at the tail-end of lookup attempts that Python will perform when trying to find an attribute on an object, and yes, you can do juts about anything there. The only thing more powerful than __getattr__ is __getattribute__ (because __getattribute__ is *always* called, while __getattr__ is only called when an attribute cannot be found). The most common use for __getattr__ is to allow virtual attributes, and the way git-python is using it is normal. Because __getattr__ can be a bit of a nuisance for introspection other helper-type methods have been added, such as __dir__ (so git-python could specify in its __dir__ method the various command-line converters it allowed); also, descriptors (such as property) are encouraged where appropriate. -- ~Ethan~ From chiller at decipherinc.com Mon Jan 27 04:43:43 2014 From: chiller at decipherinc.com (Christopher Hiller) Date: Sun, 26 Jan 2014 19:43:43 -0800 Subject: [portland] __gitattrib__ idoms. How often are they used? In-Reply-To: <52E59105.1090207@stoneleaf.us> References: <20140126200604.GA12890@mgross-Lenovo-Yoga-2-Pro> <52E56D25.90300@stoneleaf.us> <20140126220421.GA14752@mgross-Lenovo-Yoga-2-Pro> <52E59105.1090207@stoneleaf.us> Message-ID: Here are a few use cases, some more useful than others. class Baz(object): """ I namespace my variables because reasons. """ baz_sheep = 'mutton' baz_cow = 'beef' baz_pig = 'pork' def __getattr__(self, name): return getattr(self, 'baz_%s' % name) baz = Baz() print baz.cow # 'beef' class Foo(dict): """ I am some sort of struct-like object. Usefulness becomes more obvious when nested deeply: (dict) one['two']['three']['four']['five']['six'] (Foo) one.two.three.four.five.six ..but you can use me either way. """ def __getattr__(self, name): try: return self[name] except KeyError: raise AttributeError(name) def __setattr__(self, name, value): self[name] = value def __delattr__(self, name): del self[name] foo = Foo(herp='derp', hash=dict(frick='frack'), array=['tweedledee', 'tweedledum']) print foo.herp # 'derp' class Bar(Foo): """ I'm an encoded struct? I suppose this is marginally interesting. """ def __init__(self, codec, d=None, **kwargs): """ :type codec: str """ from codecs import lookup self.__dict__['__codec__'] = lookup(codec) for k, v in dict(d or dict(), **kwargs).items(): setattr(self, k, v) @property def __codec__(self): return self.__dict__['__codec__'] def __getattr__(self, name): return self.__codec__.decode(super(Bar, self).__getattr__(name))[0] def __setattr__(self, name, value): super(Bar, self).__setattr__(name, self.__codec__.encode(value)[0]) bar = Bar('rot13', beavis='butthead') print bar.beavis # 'butthead' print bar['beavis'] # 'ohggurnq' print bar.__codec__ # bar.__codec__ = 'foo' print bar.__codec__ # print bar['__codec__'] # 'sbb' bar['daria'] = 'morgendorffer' print bar.daria # 'zbetraqbessre' (oops; it wasn't encoded in the first place!) The bar.__codec__ = 'foo' is especially weird; it doesn't raise an exception but feels like it should. Couldn't figure out how to get that to happen; tried both: @property def __codec__(self, value=None): if value is not None: raise ValueError() return self.__dict__['__codec__'] and @__codec__.setter def __codec__(self, value): raise ValueError() ...but neither was triggered with a bar.__codec__ = 'foo'. Anyone know what's up with that? Chris ? --? Christopher Hiller Decipher, Inc. On January 26, 2014 at 3:36:34 PM, Ethan Furman (ethan at stoneleaf.us) wrote: On 01/26/2014 02:04 PM, mark gross wrote: > On Sun, Jan 26, 2014 at 12:16:37PM -0800, Ethan Furman wrote: >> On 01/26/2014 12:06 PM, mark gross wrote: >>> >>> But, I'd like to ask the pdx-python crew about uses of __getattrib__. >> >> There is no __getattrib__ -- there is a __getattr__ and a __getattribute__; which did you mean? > > Sorry for the type-oh. I'm talking about __getattr__ Okay, I read your blog entry -- pretty nice! And yes, __getattr__ is at the tail-end of lookup attempts that Python will perform when trying to find an attribute on an object, and yes, you can do juts about anything there. The only thing more powerful than __getattr__ is __getattribute__ (because __getattribute__ is *always* called, while __getattr__ is only called when an attribute cannot be found). The most common use for __getattr__ is to allow virtual attributes, and the way git-python is using it is normal. Because __getattr__ can be a bit of a nuisance for introspection other helper-type methods have been added, such as __dir__ (so git-python could specify in its __dir__ method the various command-line converters it allowed); also, descriptors (such as property) are encouraged where appropriate. -- ~Ethan~ _______________________________________________ Portland mailing list Portland at python.org https://mail.python.org/mailman/listinfo/portland -------------- next part -------------- An HTML attachment was scrubbed... URL: From tonyr42 at gmail.com Sun Jan 26 21:50:11 2014 From: tonyr42 at gmail.com (Tony Rick) Date: Sun, 26 Jan 2014 12:50:11 -0800 Subject: [portland] __gitattrib__ idoms. How often are they used? In-Reply-To: <52E56D25.90300@stoneleaf.us> References: <20140126200604.GA12890@mgross-Lenovo-Yoga-2-Pro> <52E56D25.90300@stoneleaf.us> Message-ID: Perhaps confusing with the -gitattributes command line option? -- - tony "I come from the nowhere, I go to the noplace, und here I am!" Aladdin and His Wonderful Lamp (Popeye, 1939) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ethan at stoneleaf.us Mon Jan 27 18:14:12 2014 From: ethan at stoneleaf.us (Ethan Furman) Date: Mon, 27 Jan 2014 09:14:12 -0800 Subject: [portland] __gitattrib__ idoms. How often are they used? In-Reply-To: References: <20140126200604.GA12890@mgross-Lenovo-Yoga-2-Pro> <52E56D25.90300@stoneleaf.us> <20140126220421.GA14752@mgross-Lenovo-Yoga-2-Pro> <52E59105.1090207@stoneleaf.us> Message-ID: <52E693E4.4080403@stoneleaf.us> On 01/26/2014 07:43 PM, Christopher Hiller wrote: > >--> class Bar(Foo): >... >... def __init__(self, codec, d=None, **kwargs): >... ... >... >... @property >... def __codec__(self): >... ... >... >... def __getattr__(self, name): >... ... >... >... def __setattr__(self, name, value): >... ... >... >--> bar = Bar('rot13', beavis='butthead') >--> bar.__codec__ = 'foo' > > The |bar.__codec__ = 'foo'| is especially weird; it doesn't raise an exception but feels like it should. Couldn't figure > out how to get that to happen [...] The issue here is that, similarly to __getattribute__, __setattr__ is /always/ called; while object.__setattr__ is smart enough to deal with descriptors such as @property, most other __setattr__s remain blissfully unaware. So the standard __setattr__ dance is something like: def __setattr__(self, name, value): if name in ('things', 'I', "don't", 'want', 'to', 'deal', 'with'): return super(MyClass, self).__setattr__(name, value) # deal with the stuff I do care about here -- ~Ethan~ From tim.glaser at pointnineseven.com Tue Jan 28 00:42:27 2014 From: tim.glaser at pointnineseven.com (Tim Glaser) Date: Mon, 27 Jan 2014 15:42:27 -0800 Subject: [portland] Great company hiring two Django devs Message-ID: Hi Folks, We at Point 97 are looking to add more Django developers to our team. Please checkout our post on Silicon Florist and feel free to share this through your networks. Thanks! http://siliconflorist.com/jobs/view/django-web-developer-sr-jr Tim Glaser -------------- next part -------------- An HTML attachment was scrubbed... URL: From chericewm at gmail.com Thu Jan 30 02:22:23 2014 From: chericewm at gmail.com (Cherice Withers-Melchior) Date: Wed, 29 Jan 2014 17:22:23 -0800 Subject: [portland] Python Position Message-ID: Hello! Cherice, here from Urban Airship! We currently have a full time opening for a Professional Services Engineer. This is a client-facing development position. We are a group of smart and collaborative people that like to work hard and also have fun. If you like to code in Python and also open to using and/or learning other tools including Java, Django, JavaScript, Redis, Android, iOS etc we would love to talk with you! The job description is on our website at www.urbanairship.com or send me an email and I will send it to you. Thank you! -- [image: UA] *Cherice Withers-Melchior* Recruiter Urban Airship | 1417 NW Everett St. | Suite 300 | Portland OR 97209 e: cherice at urbanairship.com | c: 503-201-2161 -------------- next part -------------- An HTML attachment was scrubbed... URL: From portland at s.goonmill.org Thu Jan 30 09:27:42 2014 From: portland at s.goonmill.org (Cory Dodt) Date: Thu, 30 Jan 2014 00:27:42 -0800 Subject: [portland] Python Position In-Reply-To: References: Message-ID: Hi Cherice! I am currently employed in a full-time position and no longer in the market. Thanks for thinking of me! I'll keep Urban Airship in mind if I'm in the market again soon. C _____________________ On Wed, Jan 29, 2014 at 5:22 PM, Cherice Withers-Melchior < chericewm at gmail.com> wrote: > Hello! > > Cherice, here from Urban Airship! We currently have a full time opening for > a Professional Services Engineer. This is a client-facing development > position. We are a group of smart and collaborative people that like to > work hard and also have fun. > > If you like to code in Python and also open to using and/or learning other > tools including Java, Django, JavaScript, Redis, Android, iOS etc we would > love to talk with you! > > The job description is on our website at www.urbanairship.com or send me > an > email and I will send it to you. > > Thank you! > > > -- > > [image: UA] > *Cherice Withers-Melchior* > Recruiter > Urban Airship | 1417 NW Everett St. | Suite 300 | Portland OR 97209 > e: cherice at urbanairship.com | c: 503-201-2161 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mail.python.org/pipermail/portland/attachments/20140129/7d209e47/attachment.html > > > _______________________________________________ > Portland mailing list > Portland at python.org > https://mail.python.org/mailman/listinfo/portland > -------------- next part -------------- An HTML attachment was scrubbed... URL: From portland at s.goonmill.org Thu Jan 30 09:33:22 2014 From: portland at s.goonmill.org (Cory Dodt) Date: Thu, 30 Jan 2014 00:33:22 -0800 Subject: [portland] Python Position In-Reply-To: References: Message-ID: Whoops! I've been getting so many recruiter emails lately I assumed this one was sent directly to me. Sorry everyone. :) C _____________________ On Thu, Jan 30, 2014 at 12:27 AM, Cory Dodt wrote: > Hi Cherice! > > I am currently employed in a full-time position and no longer in the > market. Thanks for thinking of me! I'll keep Urban Airship in mind if I'm > in the market again soon. > > C > > > _____________________ > > > On Wed, Jan 29, 2014 at 5:22 PM, Cherice Withers-Melchior < > chericewm at gmail.com> wrote: > >> Hello! >> >> Cherice, here from Urban Airship! We currently have a full time opening >> for >> a Professional Services Engineer. This is a client-facing development >> position. We are a group of smart and collaborative people that like to >> work hard and also have fun. >> >> If you like to code in Python and also open to using and/or learning other >> tools including Java, Django, JavaScript, Redis, Android, iOS etc we would >> love to talk with you! >> >> The job description is on our website at www.urbanairship.com or send me >> an >> email and I will send it to you. >> >> Thank you! >> >> >> -- >> >> [image: UA] >> *Cherice Withers-Melchior* >> Recruiter >> Urban Airship | 1417 NW Everett St. | Suite 300 | Portland OR 97209 >> e: cherice at urbanairship.com | c: 503-201-2161 >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mail.python.org/pipermail/portland/attachments/20140129/7d209e47/attachment.html >> > >> _______________________________________________ >> Portland mailing list >> Portland at python.org >> https://mail.python.org/mailman/listinfo/portland >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: