All Projects → zotroneneis → Magical_universe

zotroneneis / Magical_universe

Awesome Python features explained using the world of magic

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Magical universe

Competitive-Programming-Codes
Includes codes from coding competitions and contests over the internet. Languages:- Python3 and C++
Stars: ✭ 14 (-98.17%)
Mutual labels:  coding, coding-challenge
Technical Interview Guide
My learning material for technical interviews!
Stars: ✭ 76 (-90.05%)
Mutual labels:  coding, coding-challenge
Cs Fundamentals
🎓 Data structures and algorithms
Stars: ✭ 869 (+13.74%)
Mutual labels:  coding, coding-challenge
Halite Ii
Season 2 of @twosigma's artificial intelligence programming challenge
Stars: ✭ 201 (-73.69%)
Mutual labels:  coding, coding-challenge
PrepBytes-questions
One can follow to excel in coding if you are a noob!!
Stars: ✭ 46 (-93.98%)
Mutual labels:  coding, coding-challenge
pw
Best websites a Programmer should visit
Stars: ✭ 27 (-96.47%)
Mutual labels:  coding, coding-challenge
Competitive Programming Resources
This repository consists of data helpful for ACM ICPC programming contest, in general competitive programming.
Stars: ✭ 199 (-73.95%)
Mutual labels:  coding, coding-challenge
Python
covers python basic to advance topics, practice questions, logical problems in python, web development using html, css, bootstrap, jquery, DOM, Django 🚀🚀. 💥 🌈
Stars: ✭ 29 (-96.2%)
Mutual labels:  coding, coding-challenge
coding-ai
CodingAI is an open source application and it helps to find a mentor related your technologies stack.
Stars: ✭ 60 (-92.15%)
Mutual labels:  coding, coding-challenge
Stl cheat sheets
C++ STL Cheat Sheets.
Stars: ✭ 293 (-61.65%)
Mutual labels:  coding
Javascript Exercises
📚 Collection of JavaScript exercises and coding challenges.
Stars: ✭ 385 (-49.61%)
Mutual labels:  coding-challenge
Telegram List
List of telegram groups, channels & bots // Список интересных групп, каналов и ботов телеграма // Список чатов для программистов
Stars: ✭ 3,362 (+340.05%)
Mutual labels:  coding
Time2code
Portable Scalable web code editor to integrate into your sites and learning experiences
Stars: ✭ 294 (-61.52%)
Mutual labels:  coding
Coding Ios
CODING iOS 客户端源代码
Stars: ✭ 3,771 (+393.59%)
Mutual labels:  coding
Programmingdesignsystems.com
The book!
Stars: ✭ 288 (-62.3%)
Mutual labels:  coding
Programming Challenges
Algorithmic, Data Structures, Frontend and Pentest - Programming challenges and competitions to improve knowledge.
Stars: ✭ 592 (-22.51%)
Mutual labels:  coding-challenge
Codinginterviews
This repository contains coding interviews that I have encountered in company interviews
Stars: ✭ 2,881 (+277.09%)
Mutual labels:  coding-challenge
C Code Style
Recommended C code style and coding rules for standard C99 or later
Stars: ✭ 252 (-67.02%)
Mutual labels:  coding
Mern Course Bootcamp
Complete Free Coding Bootcamp with the MERN Stack
Stars: ✭ 730 (-4.45%)
Mutual labels:  coding
Interactive Coding Challenges
120+ interactive Python coding interview challenges (algorithms and data structures). Includes Anki flashcards.
Stars: ✭ 24,317 (+3082.85%)
Mutual labels:  coding

Awesome Python Features Explained Using the World of Magic

As outlined in my blog post, I decided to take on a new habit using a technique I found on the 'get disciplined' subreddit.

As one of my new habits I chose: "Code for 15 minutes every day". As part of the habit I've started creating a series of blog posts on important and awesome Python features, including object oriented programming, properties, function annotations, duck typing, etc.

Since I was bored by the usual tutorial examples, I looked for a topic that would make it fun to study and implement the concepts. And since I absolutely love Harry Potter, I started creating my own magical universe around the topics. A short introduction into my magical universe - The Tales of Castle Kilmere can be found here. So if you like magic and want to improve your Python knowledge and skills, get right into it!

A logbook of what I worked on each day can be found on my website.

The code runs in Python 3.6, the code on data classes requires Python 3.7 (or you pip install data classes for Python 3.6).

Start date: 07/23/2018

Keynote at PyCon Estonia

I gave a keynote talk about this project titled "Finding Magic in Python" at PyCon Estonia 2020. So if you are up for some magic and want to see an introduction to some of the topics (like Namedtuples or Abstract Base Classes) check out the recording on YouTube.

Running pytest

In case you get ImportError: no module named magical_universe when running pytest from within the test_code directory, take a look at this post and try running pytest from the root directory (which is the home directory in my case) using python -m pytest magical_universe/test_code/.

Overview

Day Topics Blog post with explanations Code for the day
1 Intro to object oriented programming, classes, inheritance Day 1 Code day 1
2 Class methods, instance methods, static methods, using class methods as alternative constructors Day 2 Code day 2
3 Type annotations Day 3 Code day 3
4 To-string conversion, __repr__, __str__ Day 4 Code day 4
5 Decorators Day 5 No new code added
6 Properties, @property and property(), setters, getters Day 6 Code day 6
7 Underscore patterns for variable naming, _variable, __variable, __variable__, etc. Day 7 No new code added
8 New methods and classes added to the HP universe Day 8 Code day 8
9 Duck typing, EAFP principle Day 9 Code day 9
10 & 11 Namedtuples Day 10 & 11 Code day 10 & 11
12 - 15 Abstract Base Classes Day 12 to 15 Code day 12 to 15
16 - 18 Data Classes Day 16 to 18 Code day 16 to 18
19 Immutable Data Classes Day 19 Code day 19
20 Decorators within a class Day 20 Code day 20
21 The mysterious if __name__ == "__main__" Day 21 No new code added
22 - 24 Context managers and the with statement Day 22 to 24 Code day 22 to 24
25 - 28 Testing code with pytest Day 25 to 28 Code day 25 to 28
29 - 31 Iterators, iterables, iteration Day 29 to 31 Code day 29 to 31
32 Test code for Professor class No blog post, see Day 25 to 28 for an introduction to testing Code day 32
33 Test code for Ghost class No blog post, see Day 25 to 28 for an introduction to testing Code day 33
34 Counting objects with Collections.counter Day 34 Day 34
35 Test code for DarkArmyMember class No blog post, see Day 25 to 28 for an introduction to testing Code day 35
36 Test code for Potion class No blog post, see Day 25 to 28 for an introduction to testing Code day 36
37 Extension of Magical Universe with classmethods for Charm, Hex, Curse, etc. Day 37 Code day 37
38 - 39 Test code for Spell class No blog post, see Day 25 to 28 for an introduction to testing Code day 38 to 39
40 - 42 Test code for Pupil class No blog post, see Day 25 to 28 for an introduction to testing Code day 40 to 42
43 - 45 Custom exception classes Day 43 to 45 Code day 43 to 45
46 functools.wraps - Avoiding losing metdata when applying decorators Day 46 Code day 46
47 - 48 collections.defaultdict Day 47 to 48 Code day 47 to 48
49 - 50 Working with config files Day 49 to 50 Code day 49 to 50
51 Wrap up Day 51 No new code added

Feedback

In case you find a mistake in the code or the blog posts, please let me know by opening an issue!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].