Skip to content

codefinity/c-charp-to-python-learning

Repository files navigation

C# to Python: Advanced, Production-Ready Tutorial (Python 3.14.5 + uv)

7 Day Challenge

C# to Python repository header

Who This Repository Is For

This repository is for experienced C#/.NET developers who already understand OOP, generics, LINQ, async/await, dependency injection, build tools, and testing.

The goal is to help you become an advanced Python developer who can ship production-grade code confidently.

One Week Study Plan

Use this sequence to build momentum without skipping fundamentals.

  1. Day 1: Foundations and runtime model

  2. Day 2: Functions and functional patterns

  3. Day 3: Errors, modules, and OOP modeling

  4. Day 4: Typing and advanced runtime model

  5. Day 5: Concurrency and systems

  6. Day 6: Quality, packaging, and migration mindset

  7. Day 7: Additional language features, Python-only features, and capstone

Table of Contents

Quick Start

uv sync
uv run src/csharp_to_python_learning/concepts/01_setup_and_runtime/topic_01_python_project_setup_with_uv.py
uv run -m pytest

How To Use uv In This Project

uv init

Initialize a new project (already done in this repository):

uv init --package --python 3.14.5

uv sync

Create/update .venv and install dependencies from pyproject.toml + uv.lock:

uv sync

uv run

Run a command inside the project environment:

uv run -m pytest
uv run src/csharp_to_python_learning/concepts/03_functions_and_functional_tools/topic_12_decorators.py

uv add

Add a runtime dependency:

uv add httpx

Add a dev dependency:

uv add --dev pytest ruff mypy

Running Tests

uv run -m pytest
uv run -m pytest tests/test_concept_smoke.py -k asyncio

Running Individual Examples

Every concept is runnable directly:

uv run src/csharp_to_python_learning/concepts/10_memory_idioms_migration/topic_50_python_3_14_specific_features.py

Advanced Walkthrough for C# Developers

The full concept-by-concept walkthrough is available in the pages folder:

Python-Only Features

Python-only features are organized in dedicated pages, similar to the Advanced Walkthrough:

C# Features With No Direct Python Equivalent

  • Reified generics at runtime with CLR metadata behavior.
  • Method overloading resolution by compile-time signature.
  • ref, out, and unsafe pointer patterns as first-class language features.
  • Attribute-driven compile-time/source-generator ecosystems.
  • Value types (struct) with stack semantics equivalent to .NET.

Python Features With No Direct C# Equivalent

  • Runtime monkey-patching of modules/classes/functions.
  • Descriptors as first-class attribute access primitives.
  • Structural pattern matching with heterogeneous shape patterns.
  • Context manager protocol (with) as a language-level resource hook.
  • Rich dunder protocol for integrating with core syntax at runtime.
  • Metaclass-driven class construction customization.
  • Extended iterable unpacking in assignments and function calls.

Capstone Project

Run the capstone:

uv run src/csharp_to_python_learning/capstone/capstone_async_event_pipeline.py

Capstone combines:

  • dataclasses
  • protocols/typing
  • asyncio queues/tasks
  • transformation pipeline patterns
  • logging
  • deterministic summary output

Further Study

  • Official Python docs for 3.14 language/runtime updates.
  • asyncio internals and cancellation design patterns.
  • Advanced typing (TypeVarTuple, ParamSpec, plugin/tooling ecosystems).
  • Packaging and release automation for internal Python platforms.