pymaybe icon indicating copy to clipboard operation
pymaybe copied to clipboard

`.get` conflicts with dict.get

Open smac89 opened this issue 3 years ago • 1 comments

from pymaybe import maybe
d=dict(a=23,b=43,c=dict(foo="bar"))
md=maybe(d)
md.get('a')

Error:

TypeError: get() takes 1 positional argument but 2 were given

However

d.get('a')

Output:

23

smac89 avatar Dec 08 '21 17:12 smac89

Just use the md['a'] to access the value, you don't need the get() since Maybe is already handling null safety.

EndermanAPM avatar Jun 08 '23 12:06 EndermanAPM