Option 1:

func set_default_value(section:String,key:String,value:Variant)->Variant:  
	if !self.has_section_key(section,key):  
		self.set_value(section,key,value)  
	return self.get_value(section,key)  

Option 2:

func set_default_value(section:String,key:String,value:Variant)->Variant:  
	value=self.get_value(section,key,value)  
	self.set_value(section,key,value)  
	return value  
you are viewing a single comment's thread
view the rest of the comments
[–] [S] 3 points 1 week ago

Thanks for the feedback!

It's based on Python's set_default dictionary method - it sets a value and The base class already has a set_value.

  • source
  • parent