From bcac8d5cfc5be4e9e6ee53fc8cf36db6e2f538bb Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Sun, 21 Jun 2015 22:12:09 +0530 Subject: [PATCH] Docs - fixed typo duck-typing --- humblematch/docs/Tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/humblematch/docs/Tutorial.md b/humblematch/docs/Tutorial.md index f6c8969..8097d4f 100644 --- a/humblematch/docs/Tutorial.md +++ b/humblematch/docs/Tutorial.md @@ -235,6 +235,6 @@ Infact now that we know this, in Test 2 we can remove the repetion of `w([float] I purposedly missed one method which is already there, called `w(obj).save_as(arg_name)`. How it works is that whatever it matches with is stored as `"arg_name"` and returns a dict filled with all such values, when `==`d with `other`. For eg `w([2, w(int).save_as("a"), OR(str,dict)).save_as("b")]) == [2,5,{"q":1}]` returns `{"a":5,"b":{"q":1}}`. I didnt document it well beacuse I am not mentally ok with a `==` call returning anything other than a `boolean`. Maybe, I will change the API in some way to make it better and document it then. But feel free to also try this, I am proud of this feature :) -I have not yet talked about how it helps duck-typing code till now, but I'll add it soon (there is no more API for it, just need to apply these to objects and use FunctionType as type). +I have not yet talked about how it helps duck-typing code, but I'll add it soon (there is no more API for it, just need to apply these to objects and use FunctionType as type). And thats all for now, have fun and write more code.