News for hackers. Stuff that matters.
Re:Migrating to Python 3 with pleasure by Noumenon72 on Sunday February 04, 2018 @08:48PM (#16306074)
Is there some kind of slash operator making this statement work? Is this a way to concatenate things?

train_path = datasets_root / dataset / 'train'

Re:Migrating to Python 3 with pleasure by necavi on Sunday February 04, 2018 @09:08PM (#16306150)
Python allows the overriding of just about every operator. For Pathlib they overrode the division operator to instead perform path addition in a platform agnostic manner.
Re:Migrating to Python 3 with pleasure by glandium on Sunday February 04, 2018 @10:29PM (#16306404)
> Python allows the overriding of just about every operator.

Except the boolean operators (and, or, not). For instance __and__ overrides the binary and (&), not the boolean and.

Re:Migrating to Python 3 with pleasure by Cyphase on Monday February 05, 2018 @04:42PM (#16312492)
That's True, but you _can_ override __bool__.[1]

[1] https://docs.python.org/3/reference/datamodel.html#object.__...

Re:Migrating to Python 3 with pleasure by Cyphase on Sunday February 04, 2018 @09:06PM (#16306146)
pathlib[1] has been in the standard library since Python 3.4. It can do this.[2]

[1] https://docs.python.org/3/library/pathlib.html

[2] https://docs.python.org/3/library/pathlib.html#basic-use