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

Nitpicking and minor suggestions #30

Closed
uranusjr opened this issue Sep 5, 2017 · 2 comments
Closed

Nitpicking and minor suggestions #30

uranusjr opened this issue Sep 5, 2017 · 2 comments

Comments

@uranusjr
Copy link

uranusjr commented Sep 5, 2017

3 --0-- 5 == 8 and --5 == 5 are both semantically correct statements and evaluate to True.

Might want to add that ++a and --a are both valid Python (given a is a number), but isn’t what you probably think they are (increment/decrement).

'a'[0][0][0][0][0] is also a semantically correct statement as strings are iterable in Python.

This is possible because strings are sequences, not iterables (although they are iterables as well).

Multiple Python threads don't run concurrently (yes you heard it right!).

This is not accurate. Python threads do run concurrently, but can’t run Python code concurrently. A thread can execute if another is in the middle of non-Python code execution (e.g. waiting for the response of a network call).

@satwikkansal
Copy link
Owner

@uranusjr Thank you so much for these nitpickings. I will fix these issues asap.

satwikkansal added a commit that referenced this issue Sep 6, 2017
Adds an example to illustrate absence of
Increment and Decrement operators in Python.

Related to #30
satwikkansal added a commit that referenced this issue Sep 6, 2017
* `'a'[0][0][0][0][0]` is semanically correctly not because
  strings are iterables but because they are sequences as well.

Related to #30
@satwikkansal
Copy link
Owner

@uranusjr I've tried to address your suggestions in the commits 5467a67, 24c4a64 and cc3eb36 🎉 Please feel free to reopen the issue if they are insufficient or inaccurate.

tothetop430 added a commit to tothetop430/wtfpython that referenced this issue Dec 9, 2023
Adds an example to illustrate absence of
Increment and Decrement operators in Python.

Related to satwikkansal/wtfpython#30
tothetop430 added a commit to tothetop430/wtfpython that referenced this issue Dec 9, 2023
* `'a'[0][0][0][0][0]` is semanically correctly not because
  strings are iterables but because they are sequences as well.

Related to satwikkansal/wtfpython#30
tothetop430 added a commit to tothetop430/wtfpython that referenced this issue Dec 9, 2023
* Clarifies that Python threads do run concurrently and are
  useful for I/O bound tasks.

Fixes satwikkansal/wtfpython#30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants