Use properties to set values in Info
See original GitHub issueAs I’ve mentioned in #7816 I think it would be more intuitive if users could just set values in the Info
dict using simple assignments, e.g. info['meas_date'] = None
, instead of setter methods (e.g. info.set_meas_date(None)
). This is consistent with values that we currently allow to be set directly, e.g. info["bads"] = []
.
This would also allow us to make read-only properties for fields which users should not set manually.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (13 by maintainers)
Top Results From Across the Web
PropertyInfo.SetValue Method (System.Reflection)
When overridden in a derived class, sets the property value for a specified object that has the specified binding, index, and culture-specific information....
Read more >c# - Setting a property by reflection with a string value
Ship ship = new Ship(); string value = "5.5"; var property = ship.GetType().GetProperty("Latitude"); var convertedValue = property.Converter.
Read more >How to Set Property Value using Reflection on a Value Type
PropertyInfo.SetValue method receives a System.Object as its first argument, and that is the instance on which property value should be set.
Read more >How to set a property value by reflection in C#? - Tutorialspoint
Reflection objects are used for obtaining type information at runtime. ... Sets the property value of a specified object.
Read more >PropertyInfo.SetValue - John Nelson's Blog
To set property values via Reflection, you must use the Type.GetProperty() method, then invoke the PropertyInfo.SetValue() method. The default overload that ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, this is just about the
Info
object. Intended changed usage examples:I totally agree with you - that’s why I’d use properties instead of setters.