[Python-Dev] Defining a path protocol (original) (raw)
INADA Naoki songofacandy at gmail.com
Thu Apr 7 03:04:28 EDT 2016
- Previous message (by thread): [Python-Dev] Defining a path protocol
- Next message (by thread): [Python-Dev] Defining a path protocol
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
FYI, Ruby's Pathname class doesn't inherit String.
http://ruby-doc.org/stdlib-2.1.0/libdoc/pathname/rdoc/Pathname.html
Ruby has two "convert to string" method.
.to_s
is like __str__
.
.to_str
is like __index__
but for str. It is used for implicit
conversion.
File.open accepts any object implements .to_str
.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160407/440b8e55/attachment.html>
- Previous message (by thread): [Python-Dev] Defining a path protocol
- Next message (by thread): [Python-Dev] Defining a path protocol
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]