Skip to content
Programming pages
  • Home
  • About
  • Blog
  • Toggle website search
Menu Close
  • Home
  • About
  • Blog
  • Toggle website search

Monthly Archives: July 2021

  1. Home>
  2. 2021>
  3. July

Overloading the [ ] operator for indexing and slicing

  • Post author:gwarowe
  • Post published:22 July 2021
  • Post category:Python
  • Post comments:0 Comments

The square bracket operator [ ] is used by built-in collection data types such as lists, tuples and dictionaries. The item placed inside the brackets can be a single object…

Continue ReadingOverloading the [ ] operator for indexing and slicing

Encapsulation with the @property decorator

  • Post author:gwarowe
  • Post published:9 July 2021
  • Post category:Python
  • Post comments:0 Comments

When we discussed encapsulation in classes, we saw that a class's data fields should be kept as private fields, with getter and setter methods being provided to access or change…

Continue ReadingEncapsulation with the @property decorator

Instance, static and class methods

  • Post author:gwarowe
  • Post published:6 July 2021
  • Post category:Python
  • Post comments:0 Comments

The most common use of a class is as a recipe for creating objects, each of which is a specific instance of the class. The methods that we've defined inside…

Continue ReadingInstance, static and class methods

Generator functions: send(), throw() and close()

  • Post author:gwarowe
  • Post published:1 July 2021
  • Post category:Python
  • Post comments:0 Comments

We introduced generator functions as a way of writing functions that yield successive values while maintaining the function's state in memory. We've seen how to use the yield statement to…

Continue ReadingGenerator functions: send(), throw() and close()

Generator functions and the yield statement

  • Post author:gwarowe
  • Post published:1 July 2021
  • Post category:Python
  • Post comments:0 Comments

[latexpage] A normal function in Python can be terminated with a return statement, which may or may not return a value back to the statement that called the function. After…

Continue ReadingGenerator functions and the yield statement

Archives

  • July 2021
  • June 2021
  • May 2021
  • April 2021

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Recent Posts

  • Overloading the [ ] operator for indexing and slicing
  • Encapsulation with the @property decorator
  • Instance, static and class methods
  • Generator functions: send(), throw() and close()
  • Generator functions and the yield statement

PhysicsPages

I also host Physics pages, a blog with notes on physics.

Recent Posts

  • Overloading the [ ] operator for indexing and slicing
  • Encapsulation with the @property decorator
  • Instance, static and class methods
  • Generator functions: send(), throw() and close()
  • Generator functions and the yield statement

Recent Comments

  • Utkarsha Srivastava on Sets
  • InOnIt Blog on Sets

Archives

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Archives

  • July 2021
  • June 2021
  • May 2021
  • April 2021

Categories

  • Python

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
  • Facebook
  • Twitter
  • Instagram
  • Email
Copyright - OceanWP Theme by OceanWP