You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromlpythonimportf64frommathimportpiclassCircle:
def__init__(self:"Circle", radius:f64):
self.radius :f64=radiusdefcircle_area(self:"Circle")->f64:
returnpi*self.radius**2.0defcircle_print(self:"Circle"):
area : f64=self.circle_area()
print("Circle: r = ",str(self.radius)," area = ",str(area))
defmain():
c : Circle=Circle(1.0)
c.circle_print()
c.radius=1.5c.circle_print()
main()
This results in a SEGFAULT as the self variable is not initialised before function call. I think atleast the class_type should be set to the parent class. @Thirumalai-Shaktivel
The text was updated successfully, but these errors were encountered:
Ex:
This results in a SEGFAULT as the
self
variable is not initialised before function call. I think atleast theclass_type
should be set to the parent class.@Thirumalai-Shaktivel
The text was updated successfully, but these errors were encountered: