Clickable hyperlinks
Rodrigo Bistolfi
rbistolfi at gmail.com
Tue Jan 3 17:44:34 EST 2017
2017-01-04 7:39 GMT-03:00 Steve D'Aprano <steve+python at pearwood.info>:
> On Wed, 4 Jan 2017 08:32 pm, Deborah Swanson wrote:
>
> Aside: you've actually raised a fascinating question. I wonder whether
> there
> are any programming languages that understand URLs as native data types, so
> that *source code* starting with http:// etc is understood in the same way
> that source code starting with [ is seen as a list or { as a dict?
> ...
>
Some Smalltalk implementations have something that comes close:
st> 'https://python.org' asUrl retrieveContents
`asUrl` would be a string method returning a URL instance, which also has a
convenient method `retrieveContents` wrapping an http client. Not hard to do
with Python, I think this could be an interesting exercise for a learner.
More information about the Python-list
mailing list