# Python upcast failure

**URL:** <https://forum.makecode.com/t/python-upcast-failure/30419>\
**Category:** Arcade\
**Created:** [September 3, 2024, 4:49pm UTC](https://forum.makecode.com/t/python-upcast-failure/30419 "2024-09-03T16:49:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bex](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@bex](https://forum.makecode.com/u/bex)\
**Post date:** [September 3, 2024, 4:49pm UTC](https://forum.makecode.com/t/python-upcast-failure/30419/1 "2024-09-03T16:49:05Z")

</div>

It appears that Static Python doesn’t support upcasting. I am curious if I’m doing something incorrectly, or if there is there a technique or workaround.

Demo project:

> **[python upcasting test](https://arcade.makecode.com/S66646-74071-49449-28049)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

The demo code:

class Animal:  
def **init** (self, name: str):  
self.name: str = name  
def printname(self):  
print(self.name)

class Dog(Animal):  
def **init** (self, name):  
super(). **init** (name)

a: Animal = None  
a = Dog(“terrier”) # ← types not compatible: Animal and Dog  
a.printname()
