Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Concept Documents] : comparisons concept #2456 #2733

Merged
merged 47 commits into from
Nov 15, 2021
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9d913b8
Add blurb for Comparison concept
gurupratap-matharu Nov 8, 2021
a20072e
Add introduction for Comparisons concept
gurupratap-matharu Nov 8, 2021
aadeb28
Add documentation for about.md for Comparisons concept on python track
gurupratap-matharu Nov 8, 2021
30bd1f0
Add links to resources for comparisons concept in python track
gurupratap-matharu Nov 8, 2021
2ec216a
Update concepts/comparisons/.meta/config.json
gurupratap-matharu Nov 12, 2021
d9c24aa
Update concepts/comparisons/.meta/config.json
gurupratap-matharu Nov 12, 2021
afe1bb0
Update concepts/comparisons/.meta/config.json
gurupratap-matharu Nov 12, 2021
f7d4566
Update concepts/comparisons/about.md
gurupratap-matharu Nov 12, 2021
759d03c
Update concepts/comparisons/links.json
gurupratap-matharu Nov 12, 2021
f4a5de2
Update concepts/comparisons/links.json
gurupratap-matharu Nov 12, 2021
c9b47b9
Update concepts/comparisons/introduction.md
gurupratap-matharu Nov 12, 2021
4a43927
Update description for official python operators
gurupratap-matharu Nov 12, 2021
0c5a5a9
Add note about short circuiting in comparison chaining
gurupratap-matharu Nov 12, 2021
e5883da
changed unpacking declaration to simple declaration
gurupratap-matharu Nov 12, 2021
3955479
Update concepts/comparisons/about.md
gurupratap-matharu Nov 12, 2021
9257582
Update example of membership test with better variable names
gurupratap-matharu Nov 12, 2021
3c983ff
Changed double quotes to single ones for consistency
gurupratap-matharu Nov 12, 2021
706a158
Update concepts/comparisons/about.md
gurupratap-matharu Nov 12, 2021
a302c3e
Update concepts/comparisons/links.json
gurupratap-matharu Nov 12, 2021
76d63ad
Add comparisons link at the bottom of the document
gurupratap-matharu Nov 14, 2021
10a104e
Add note for comparison priority
gurupratap-matharu Nov 14, 2021
ce782eb
Update concepts/comparisons/about.md
gurupratap-matharu Nov 14, 2021
a41cac4
Add link for arithmetic conversions
gurupratap-matharu Nov 14, 2021
5e540fd
Add example for complex number comparison
gurupratap-matharu Nov 14, 2021
ccd4f5e
Update concepts/comparisons/about.md
gurupratap-matharu Nov 14, 2021
c1ababc
Update concepts/comparisons/about.md
gurupratap-matharu Nov 14, 2021
1476cbf
Update concepts/comparisons/about.md
gurupratap-matharu Nov 14, 2021
ca3d0a3
Add period and convert statement to h3
gurupratap-matharu Nov 14, 2021
e812e82
Replace single letter variable with more verbose ones
gurupratap-matharu Nov 14, 2021
8ba2822
Update example of membership test
gurupratap-matharu Nov 14, 2021
11530ea
Update concepts/comparisons/about.md
gurupratap-matharu Nov 14, 2021
4985beb
Minor apostrophe update
gurupratap-matharu Nov 14, 2021
61cb7fd
Update concepts/comparisons/about.md
gurupratap-matharu Nov 14, 2021
dd6cc57
Update concepts/comparisons/about.md
gurupratap-matharu Nov 14, 2021
1cfe9b0
Update concepts/comparisons/introduction.md
gurupratap-matharu Nov 14, 2021
17dd5bc
Update concepts/comparisons/about.md
gurupratap-matharu Nov 14, 2021
f936928
Add chinese and korean strings for comparison
gurupratap-matharu Nov 14, 2021
92d3511
Update concepts/comparisons/about.md
gurupratap-matharu Nov 14, 2021
eed9c6a
Update concepts/comparisons/about.md
gurupratap-matharu Nov 14, 2021
2321489
Fix broken link due to mistyped word
gurupratap-matharu Nov 14, 2021
a5306de
Remove code samples and change prose as per about.md
gurupratap-matharu Nov 14, 2021
a2a5ae0
Update concepts/comparisons/.meta/config.json
BethanyG Nov 14, 2021
11acd58
Apply suggestions from code review
BethanyG Nov 14, 2021
aa18a17
Change examples of chinese and korean words
gurupratap-matharu Nov 15, 2021
a22047e
Mention Chinese and Korean in title case
gurupratap-matharu Nov 15, 2021
402295d
Update concepts/comparisons/about.md
J08K Nov 15, 2021
a41b825
Update concepts/comparisons/about.md
J08K Nov 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add link for arithmetic conversions
gurupratap-matharu committed Nov 14, 2021
commit a41cac4dfc122d283ba3d37b5ad7c4a9ecffc412
3 changes: 2 additions & 1 deletion concepts/comparisons/about.md
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ False

## Comparison between different data types

Since everything in Python is an `object`, things can get interesting when objects of different types are compared. For example, the `str` value of a number is considered completely different from the `integer` or `floating-point` value. However, an `integer` **can** be considered equal to a `float`, as they are both numeric types that Python can implicitly convert to compare. For other numeric types, comparison operators are defined where they "make sense", but throw a `TypeError` if the underlying objects cannot be converted for comparison. For more information on the rules that python uses for numeric conversion, see [arithmetic conversions][arithmetic conversions] in the Python documentation.
Since everything in Python is an `object`, things can get interesting when objects of different types are compared. For example, the `str` value of a number is considered completely different from the `integer` or `floating-point` value. However, an `integer` **can** be considered equal to a `float`, as they are both numeric types that Python can implicitly convert to compare. For other numeric types, comparison operators are defined where they "make sense", but throw a `TypeError` if the underlying objects cannot be converted for comparison. For more information on the rules that python uses for numeric conversion, see [arithmetic conversions][arithmetic conversions] in the Python documentation.
BethanyG marked this conversation as resolved.
Show resolved Hide resolved

```python
>>> 17 == '17'
@@ -162,3 +162,4 @@ False
```

[comparisons]: https://docs.python.org/3/library/stdtypes.html?highlight=comparisons#comparisons
[arithmetic conversion]: https://docs.python.org/3/reference/expressions.html?highlight=number%20conversion#arithmetic-conversions