Advertisement
silver2row

trying strings and integers for class work

Oct 30th, 2022
1,162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. class NamedStr_Str(str, str):
  2.     Servo_Angles = {'name': '{}'}
  3.     def __new__(cls, value, value):
  4.         value = cls.Servo_Angles.get(value, value)
  5.         return super().__new__(cls, value)
  6.  
  7. class NamedStr_Int(str, int):
  8.     Servo_Channel_Angles = {'channel': {}, 'max_angle': {}}
  9.     def __new__(cls, 'str', value}:
  10.         value = cls.Servo_Channel_Angles.get(value, value)
  11.         return super().__new__(cls, value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement