Skip to content

Commit 546ce89

Browse files
committed
[PENDING]
1 parent a858501 commit 546ce89

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

_posts/2019-01-14-fstrings-yet-another-string-formatter-in-python.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ formatted string. All names wrapped inside the curly braces ({}) are resolved
1919
with the value of variable available in local scope. If the variable isn’t found
2020
in the local scope then it will raise a ```NameError``` exception.
2121

22+
TODO: ADD below things
23+
1. Multiline Fstring
24+
2. FString by calling function or class methods
25+
3. Fstring as dictionary key
26+
4. Fstring by using capital 'F'.
2227

2328
### Demonstration
2429

@@ -31,9 +36,6 @@ name = "Jay"
3136
print(f"Hello {name}")
3237
```
3338

34-
[ TODO: Find, Are there any tool avilable to convert all a formatted strings to
35-
Fstrings?]
36-
3739
In my view, this option of string formation is more concise and readable than
3840
all other options. I advise migrating your code to Fstrings if your Python
3941
interpreter is greater than or equal to version 3.6. You should note that
@@ -46,10 +48,10 @@ depreciate in the near future.
4648

4749
* Fstring can be elaborated as "Formatted String".
4850

49-
* Variable is always resolved at local scope. If it isn't found then it will
50-
rise the ```NameError``` exception.
51+
* Variable is always resolved at a local scope. If it isnt found then it will
52+
raise the ```NameError``` exception.
5153

5254
* You can format your strings by Fstring approach only if your Python
5355
interpreter version is greater than or equal to 3.6.
5456

55-
* Existing string formation approches are not subjected to depricate soon.
57+
* Existing string formation approaches are not subjected to deprecate soon.

0 commit comments

Comments
 (0)