mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-10-31 16:07:44 +03:00 
			
		
		
		
	Use classes when type hinting primitives
This commit is contained in:
		
							parent
							
								
									cb56c54351
								
							
						
					
					
						commit
						63ef7284f7
					
				|  | @ -120,8 +120,8 @@ def _write_modules( | |||
|                                                 for c in constructors))) | ||||
| 
 | ||||
|             imports = {} | ||||
|             primitives = ('int', 'long', 'int128', 'int256', 'string', | ||||
|                           'date', 'bytes', 'true') | ||||
|             primitives = {'int', 'long', 'int128', 'int256', 'double', | ||||
|                           'string', 'date', 'bytes', 'Bool', 'true'} | ||||
|             # Find all the types in other files that are used in this file | ||||
|             # and generate the information required to import those types. | ||||
|             for t in tlobjects: | ||||
|  |  | |||
|  | @ -170,9 +170,11 @@ class TLArg: | |||
|             'long': 'int', | ||||
|             'int128': 'int', | ||||
|             'int256': 'int', | ||||
|             'double': 'float', | ||||
|             'string': 'str', | ||||
|             'date': 'Optional[datetime]',  # None date = 0 timestamp | ||||
|             'bytes': 'bytes', | ||||
|             'Bool': 'bool', | ||||
|             'true': 'bool', | ||||
|         }.get(cls, "'Type{}'".format(cls)) | ||||
|         if self.is_vector: | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user