Logo Anna-Lena Popkes
  • Home
  • About
  • Skills
  • Experiences
  • Projects
  • More
    Projects Talks & Podcasts Recent Posts
  • Posts
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • Posts
  • Personal news
  • My path to machine learning
  • Books
    • Personal reading List
    • Deep work
  • Machine Learning
    • Bayesian linear regression
    • KL Divergence
    • Principal component analysis (PCA)
    • Support vector machines
    • Variational Inference
  • Python
    • Coding with kids
    • Mocking
    • Packaging tools
    • Magical Universe
      • Start
      • The Tales of Castle Kilmere
      • Object-oriented programming
      • Types of methods
      • Type annotations
      • To-string conversion
      • Decorators
      • Properties
      • Underscore patterns
      • Extending the universe
      • Duck Typing
      • Namedtuples
      • Abstract Base Classes
      • Data classes
      • Immutable data classes
      • Decorators in classes
      • if __name__ == "__main__"
      • Context managers
      • Testing with pytest
      • Iterators
      • Multisets
      • Extending the universe II
      • Exception classes
      • functools.wraps
      • Defaultdict
      • Config files
      • Wrap up
  • Software Engineering
    • Intro to containers
    • Intro to Docker
    • Intro to virtual machines
Hero Image
To-string conversion

Topics: to-string conversion, __repr__, __str__ Updated: 2020-10-04 To-string conversion Today we are going to look at the two methods that control how an object is converted into a string object. When we just print an object, we won’t get a useful representation. For example, when trying to print the bromley instance: bromley = CastleKilmereMember(name='Bromley Huckabee', birthyear=1959, sex='male') print(bromley) We get this output: <__main__.CastleKilmereMember object at 0x7f81853bfc50>. It contains the name of the class an the ID of the object (its memory address).

Thursday, July 26, 2018 Read
Hero Image
Type annotations

Topics: Type annotations Updated 2020-10-04 Type annotations Type annotations are a very cool feature that came out with Python 3.5. They allow us to add arbitrary metadata to function arguments and the return value of a function. Why this is useful? First of all, it allows us to document of what type our function parameters are. Furthermore, they can be used for things like type checking. For more use cases, look here.

Wednesday, July 25, 2018 Read
Hero Image
Types of class methods

Topics: class methods, instance methods, static methods, using class methods as alternative constructors Updated 2020-10-03 Types of methods A class can have three types of methods: instance methods, class methods and static methods. Instance methods are the most common type of method. They take at least the parameter self as an input. This parameter points towards an instance of the class when the method is called. An instance method can modify both object state (through the self parameter) and class state indirectly (through the self.

Tuesday, July 24, 2018 Read
Hero Image
Object-oriented programming

Topics: object oriented programming, classes, inheritance I want to start with using some of the things I learned from the “Python Tricks” book (see my reading list for more details on the book). Therefore, I will start creating a little Magical Universe with classes and methods related to the Tales of Castle Kilmere. So let’s start with the most important basics. What is Object Oriented Programming ? Object-oriented programming (OOP) is a specific programming paradigm.

Monday, July 23, 2018 Read
Hero Image
100 Days of code - Creating my personal Magical Universe

I have decided to take on a new habit using a technique I found on the ‘get discplined’ subreddit. The technique works as follows: Take a piece of paper or card Draw 6 vertical lines intersecting 6 horizontal lines. This creates a 7x7 grid of 49 squares Choose a daily habit you want to work on and write it down on the back of the card Also put down WHY you want to work on the habit Start working on the habit TODAY!

Sunday, July 22, 2018 Read
Hero Image
The Tales of Castle Kilmere

My magical universe: “The Tales of Castle Kilmere” The main character of our magical universe is named Lissy Spinster. Lissy is a quiet, clumsy girl of age twelve. Although she is sticking her nose into books most of the time, she is always watching her surroundings very closely. Lissy and her older brother Gary don’t get along very well. Gary considers his sister a little weird and is spending most of his time outside, playing broom socker with his friends.

Sunday, July 22, 2018 Read
  • ««
  • «
  • 1
  • 2
  • 3
  • »
  • »»
Navigation
  • About
  • Skills
  • Experiences
  • Education
  • Projects
  • Talks & Podcasts
  • Recent Posts
Contact me:
  • popkes@gmx.net
  • zotroneneis

Toha Theme Logo Toha
© 2020-2021 Copyright.
Powered by Hugo Logo