[issue41935] Add binary operator!

2020-10-04 Thread Hadi Alqattan


New submission from Hadi Alqattan :

What are your opinions about adding a binary operator to Python in order to 
make this code possible?
```
my_counter = 0

for i in rage(1000):
my_counter += 1 if (i % 2) == 0
```

--
components: Interpreter Core
messages: 377976
nosy: hadialqattan
priority: normal
severity: normal
status: open
title: Add binary operator!
type: enhancement
versions: Python 3.10

___
Python tracker 
<https://bugs.python.org/issue41935>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Hadi Alqattan


Hadi Alqattan  added the comment:

You're right, I'm sorry.

--

___
Python tracker 
<https://bugs.python.org/issue41934>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Hadi Alqattan


Change by Hadi Alqattan :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue41934>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Hadi Alqattan


New submission from Hadi Alqattan :

Adding a new method to `pathlib.Path` class, `has` method is a method that can 
determine if the `Path` object has a specific file/dir or not.

Assume that we have a `Path` object for this `project/` directory:
```
project/
  main.py
  __init__.py
  utils/
```
and we want to know if the project directory has `main.py` or not, after adding 
this method we will be able to do this:
```
from pathlib import Path

project_path = Path("./project")

if project_path.has("main.py"):
pass  # do something.
```

--
components: Library (Lib)
messages: 377973
nosy: hadialqattan
priority: normal
severity: normal
status: open
title: Add `has` method to `pathlib.Path` class.
type: enhancement
versions: Python 3.10

___
Python tracker 
<https://bugs.python.org/issue41934>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com