app-store-server-library-python
app-store-server-library-python copied to clipboard
refactor library utility more pythonic
- use
.getinstead ofinand[]preventing extra dictionary lookup - use f-strings (since we support only 3.8+) reduce string concatenation overhead
- use walrus operator (3.8+) remove extra
getattraccess in caseraw_fieldfound
@Reskov Are there any performance or other reasons for performing this change besides style?
This is more about style, rather the performance. For example, in +[] will get one extra dictionary lookup, so as general rule it is better to use get in such case. The same true about getattr, or f-string. But the impact of this is very low, so I am not sure that we will notice this in practice.