mirror of
				https://github.com/pocketpy/pocketpy
				synced 2025-10-26 22:40:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			330 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			330 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | |
| icon: package
 | |
| label: dataclasses
 | |
| ---
 | |
| 
 | |
| ### `dataclasses.dataclass`
 | |
| 
 | |
| A decorator that is used to add special method to classes, including `__init__`, `__repr__` and `__eq__`.
 | |
| 
 | |
| ### `dataclasses.asdict(obj) -> dict`
 | |
| 
 | |
| Convert a dataclass instance to a dictionary.
 | |
| 
 | |
| #### Source code
 | |
| 
 | |
| :::code source="../../python/dataclasses.py" ::: |