[issue33739] pathlib: Allow ellipsis to appear after "/" to navigate to parent path

2018-06-02 Thread Yury Selivanov


Yury Selivanov  added the comment:

Since nobody likes the idea I'm withdrawing the proposal.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue33739] pathlib: Allow ellipsis to appear after "/" to navigate to parent path

2018-06-02 Thread Brett Cannon


Brett Cannon  added the comment:

I'm personally not loving the idea either by re-purposing Ellipsis for this 
since my brain keeps thinking you're trying to go two levels up instead of just 
one with that extra dot. It should also be mentioned that paths ending in an 
ellipsis has actual meaning in Perforce when it comes at the end of a path.

--

___
Python tracker 

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



[issue33739] pathlib: Allow ellipsis to appear after "/" to navigate to parent path

2018-06-02 Thread Timo Furrer


Timo Furrer  added the comment:

> I've just tried, "..." doesn't seem to mean anything on the Windows CLI.

It's not only about Windows / Linux here - it's about the shell and command 
which is being used. If we talk about "cd" for example - it's a builtin in most 
common shells on Linux, which behave differently:

bash:

/a/b/c $ cd ...
bash: cd: ...: No such file or directory

dash:

/a/b/c $ cd ...
dash: 8: cd: can't cd to ...

zsh:

/a/b/c $ cd ...
/a $

I think using '...' to navigate to the parent is confusing. 
It's well known and agreed that '..' is for navigating to the parent. 
'...' looks similar but is definitely not the same as '..' and therefore 
shouldn't be treated as such.

--
nosy: +tuxtimo

___
Python tracker 

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



[issue33739] pathlib: Allow ellipsis to appear after "/" to navigate to parent path

2018-06-02 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I've just tried, "..." doesn't seem to mean anything on the Windows CLI.

But I agree with the reservation that having "..." mean something different 
than ".." is a recipe for confusion.

--
nosy: +steve.dower

___
Python tracker 

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



[issue33739] pathlib: Allow ellipsis to appear after "/" to navigate to parent path

2018-06-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Note that 'a/b/c/..' is not the same as 'a/b' if 'c' is a link. And since "p / 
..." looks very similar to "p / '..'", it will cause mistakes. "p.parent" is 
more explicit.

AFAIK in cmd.exe on Windows 'a/b/c/...' means 'a/b/c/../..'. This is yet one 
source of confusion.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33739] pathlib: Allow ellipsis to appear after "/" to navigate to parent path

2018-06-01 Thread Yury Selivanov


Change by Yury Selivanov :


--
keywords: +patch
pull_requests: +6958

___
Python tracker 

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



[issue33739] pathlib: Allow ellipsis to appear after "/" to navigate to parent path

2018-06-01 Thread Yury Selivanov


New submission from Yury Selivanov :

We can allow using ... to navigate the "parent" path:

>>> import pathlib
>>> p = pathlib.Path('a/b/c')
>>> p
PosixPath('a/b/c')
>>> p / ...
PosixPath('a/b')
>>> p / ... / ... / 'temp'
PosixPath('a/temp')

The patch is trivial and I think that using "..." instead of ".parent" makes 
code clearer and cuter.

--
components: Library (Lib)
messages: 318468
nosy: brett.cannon, pitrou, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: pathlib: Allow ellipsis to appear after "/" to navigate to parent path
type: enhancement

___
Python tracker 

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