Open in app
Home
Notifications
Lists
Stories

Write
Diane Khambu
Diane Khambu

Home
About

Published in Geek Culture

·Jun 21

Modulo operator in Python

It’s been more than a month, I have not written new learnings. So here I am going to write about modulo operator in Python. Got stumbled by modulo operator for negative numbers. I had come across it once. So here I am listing how modulo operates. A quick primer on…

Modulo

3 min read

Modulo operator in Python
Modulo operator in Python

Published in Python in Plain English

·May 8

An Introduction to Dataclass Decorators in Python

Something new I came across while storing data stream to Python class is Dataclass! Let’s dive in. dataclass is a decorator imported from dataclasses module and generates special methods such as __init__ , __repr__ to user-defined classes. Let’s see an example: On running the file, we get: Generated special…

Dataclass

3 min read

Dataclass in Python
Dataclass in Python

Apr 25

generators in __init__.py file — Python

If you have come across application directories in python, you must have seen directories converted to packages with __init__.py file. The basic function of the file is to initialize a directory just like in class where we use __init__ method to initialize a class. That was my understanding, until recently…

Initialization

4 min read

generators in __init__.py file — Python
generators in __init__.py file — Python

Published in Towards Dev

·Apr 11

logger module in Python

Logging in Python codebase had been pretty mysterious to me while working in large codebases. I had not set the configuration nor did I look at the configurations in detail but used logging functionality often for debugging. Later did some extension on an existing logging configuration for a utility program…

Python 3

4 min read

logger module in Python
logger module in Python

Published in Geek Culture

·Apr 2

Type Hints Annotations in Python

Came across functions in Python that had inline annotation of arguments passed to the function and annotated return type as well. It looked so similar to Dafny and Lustre language that I’d learned in Formal Methods class in graduate school. Was a bit surprised that their exist such a feature…

Type Annotation

3 min read

Type Hints Annotations in Python
Type Hints Annotations in Python

Mar 14

What is a Dockerfile?

In this article we’ll learn about Dockerfile and create a simple container based on it! When I first saw a Docker logo 🐳 few years ago, timeline wise it was after completing graduate school, thought it was cute and clever. It must have been a buzz word then. Tried two…

Dockerfiles

5 min read

What is a Dockerfile?
What is a Dockerfile?

Published in Nerd For Tech

·Mar 5

yield from — Python (Part IV)

We now know what a generator is, how to send values to a generator, and how to close a generator. This article is looking at how we can have two-way communications using caller, sub-generator using yield from , yield and send. We know how we can generate and consume values…

Yield

3 min read

yield from — Python (Part IV)
yield from — Python (Part IV)

Published in Geek Culture

·Feb 26

yield — Python (Part III)

In this article we’ll see how we can close generators and throw exceptions to generators. If you want to know what is a generator, sending values to generator, you can look at part I and part II of the yield series respectively. Let’s take an example of reading a file…

Python Yield

3 min read

Yield — Python (Part III)
Yield — Python (Part III)

Published in Python in Plain English

·Feb 19

How to Pass Value to Generators Using the “yield” Expression in Python

Part II: A guide on passing values to generators using the “yield” expression in Python. — This part of the yield article is about sending value to generators. We have talked about yield , generators, how generators are used as coroutines, and states of a generator in part I of the yield article. Let’s check out how we can pass value to generators. yield is an…

Python

3 min read

How to Pass Value to Generators Using the “yield” Expression in Python
How to Pass Value to Generators Using the “yield” Expression in Python

Feb 13

yield — Python (Part I)

yield keyword looked pretty mysterious when occasionally encountered. Here we are unpacking what yield does by looking at how generator uses yield to get values or return back control to a caller. We are also looking at different states of a generator. Let’s dive in. Generator function: A function that…

Python

3 min read

yield — Python (Part I)
yield — Python (Part I)
Diane Khambu

Diane Khambu

Software Engineer

Following
  • Spencer Carli

    Spencer Carli

  • Adhithi Ravichandran

    Adhithi Ravichandran

  • Sunil Sandhu

    Sunil Sandhu

  • MacKenzie Scott

    MacKenzie Scott

  • Maneesha Sushama Pradeep

    Maneesha Sushama Pradeep

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Knowable