Typing ResourceState and setting the default are most commonly going to be duplicated. This is similar for State values and the valid_type argument.
This looks more complicated:
class CashRegister(UP.Actor):
waiting_customers = UP.ResourceState[simpy.Store](default=simpy.Store)
number_served = UP.State[int](default=0, valid_types=int)
than this:
class CashRegister(UP.Actor):
waiting_customers = UP.ResourceState[simpy.Store]()
number_served = UP.State[int](default=0)
Any changes made here would have to allow for union types that would still require a single default value.
Typing
ResourceStateand setting the default are most commonly going to be duplicated. This is similar forStatevalues and thevalid_typeargument.This looks more complicated:
than this:
Any changes made here would have to allow for union types that would still require a single default value.