You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While on the topic of operator overloading on the SO Python chat, I got the idea after chatting with @amcgregor that adding a slice notation to a URI would be a nice extension of this embedded DSL syntax:
Example:
url = URI["username":"password"]
This would be easy and intuitive in interactive sessions, without extra API namespace clutter.
The text was updated successfully, but these errors were encountered:
Experimenting in a REPL, I was dubious about the use of colon notation, however, apparently, slice() is a honey-badger and doesn't care that the "indexes" are non-numeric. Yay!
In the process of implementing, use of slices this way will return a new URI instance and will not mutate the original. Isolation of this behaviour to slices preserves existing mapping behaviour of URIs to their query string components.
While on the topic of operator overloading on the SO Python chat, I got the idea after chatting with @amcgregor that adding a slice notation to a URI would be a nice extension of this embedded DSL syntax:
Example:
This would be easy and intuitive in interactive sessions, without extra API namespace clutter.
The text was updated successfully, but these errors were encountered: