Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testdata.duck #35

Open
Jaymon opened this issue Sep 28, 2018 · 0 comments
Open

testdata.duck #35

Jaymon opened this issue Sep 28, 2018 · 0 comments

Comments

@Jaymon
Copy link
Owner

Jaymon commented Sep 28, 2018

as discussed in #32 I think I should add a testdata.duck that can take an object and produce an object similar to the passed in object, but it should also have the ability to convert it into a dict and things like that, so if I had something like:

class Foo(object):
    bar = 1
    che = 2

I could do this:

f = Foo()
print(f.bar) # 1

duck = testdata.duck(f)
print(duck.bar) # 1
print(duck.duckdict["bar"]) # 1

You could have a whole host of duck* methods on the duck-typed class

Jaymon added a commit that referenced this issue Feb 5, 2020
… interface is only partly related to issue #35 and issue #45. It might eventually work for all of those ideas but right now the interface is rough. Moves data.py into the data/ util to remove a warning, I'm not sure why python was complaining about the data directory not having an __init__.py file when there was a data.py file, but it was. Updates the setup.py file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant