Here is better solution for your example. If you are going to make a lot of instances from item, you can make a function for constructing and call it when you instance the class.