Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to delete an attribute of an object python

del Obj.attri
Comment

Python Deleting Attributes and Objects

>>> num1 = ComplexNumber(2,3)
>>> del num1.imag
>>> num1.get_data()
Traceback (most recent call last):
...
AttributeError: 'ComplexNumber' object has no attribute 'imag'

>>> del ComplexNumber.get_data
>>> num1.get_data()
Traceback (most recent call last):
...
AttributeError: 'ComplexNumber' object has no attribute 'get_data'
Comment

PREVIOUS NEXT
Code Example
Python :: fancy index python 
Python :: Python Pipelining Generators 
Python :: Python match.start(), match.end() 
Python :: what does bin do in python 
Python :: numpy addition operation using numpy functions 
Python :: Pandas index column title or name 
Python :: keras imagenet 
Python :: send2trash 
Python :: Top n rows of each group 
Python :: python break string to sections 
Python :: python check if array alternating 
Python :: truncated float python 
Python :: Python RegEx Split – re.split() Syntax 
Python :: dict get keys tcl 
Python :: sorting list of strings by length python 
Python :: Extracting the cluster labels from a dendrogram 
Python :: sample stochastic gradient boosting regressor algorithm 
Python :: how to calculate the area and perimeter of a shape in python 
Python :: For_else 
Python :: pythonanywhere API example 
Python :: a list of available font in figlet in python 
Python :: Replace and count string delimiter 
Python :: How to Merge QuerySets in Django Rest Framework 
Python :: visualizing of convolutional kernels using pytorch 
Python :: trends in yearly data python 
Python :: if user_answer==answer: ecpeted index erroe pythin fx 
Python :: ValueError: expected sparse matrix with integer values, found float values 
Python :: list of letter in word python 
Python :: using -h on python file 
Python :: ModelCheckpoint 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =