<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Python Class Attributes on Amit Agarwal Linux Blog</title>
    <link>/tags/python-class-attributes/</link>
    <description>Recent content in Python Class Attributes on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 21 May 2018 01:08:31 +0000</lastBuildDate>
    
	<atom:link href="/tags/python-class-attributes/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Python Class Attributes: An Overly Thorough Guide</title>
      <link>/2018/05/21/python-class-attributes-overly-guide/</link>
      <pubDate>Mon, 21 May 2018 01:08:31 +0000</pubDate>
      
      <guid>/2018/05/21/python-class-attributes-overly-guide/</guid>
      <description>&lt;p style=&#34;text-align: center;&#34;&gt;
  &lt;strong&gt;This &lt;a href=&#34;https://www.toptal.com/python/python-class-attributes-an-overly-thorough-guide&#34;&gt;article&lt;/a&gt; is originally published at &lt;a href=&#34;https://www.toptal.com/python&#34;&gt;Toptal&lt;/a&gt;.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;I had a &lt;a href=&#34;https://www.toptal.com/python/job-description&#34;&gt;programming interview&lt;/a&gt; recently, a phone-screen in which we used a &lt;a href=&#34;https://code.stypi.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;collaborative text editor&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I was asked to implement a &lt;a href=&#34;https://www.toptal.com/api-developers/5-golden-rules-for-designing-a-great-web-api&#34;&gt;certain API&lt;/a&gt;, and chose to do so in &lt;a href=&#34;https://www.toptal.com/python&#34;&gt;Python&lt;/a&gt;. Abstracting away the problem statement, let’s say I needed a class whose instances stored some &lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      data
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt; and some &lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      other_data
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
