-
Notifications
You must be signed in to change notification settings - Fork 59
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
Namedtuples? #37
Comments
Yes, this is another "face" to a major known bug. It is directly related to a couple of other such things. Check out my fork at: https://github.com/BuvinJT/Opy If you dig deep into my readme, you'll see a list of bugs I've documented and the workarounds for them. This issue is right at the top of the list for problems. Refer to these very similar issues:
Workaround: A) Use positional arguments B) Append the argument keywords to the plain_names list.
Workaround: Define the dictionaries and/or key constants in a dedicated module (for import where needed), which is then added to the plain_files list. |
I'm developing Opy further as a component within a large project. https://github.com/BuvinJT/distbuilder I plan to spend a while hammering on this library until all the kinks are worked out. I'm perhaps a month out from getting into that, and then it might another one or two before I've "perfected" it to my liking. You can certainly check back in on my projects periodically to see when I get around to patching this issue. |
Thx for this info Buvin, i will try out your interim fixes by adding to the plain_names |
Actually, this excerpt from my readme might help you get over the hump help with your named tuples problem: (UNRESOLVABLE?) Bug: Dynamically created object attributes cannot be referenced directly. Example: The popular argparse module creates attributes "magically" e.g. shoen below with "foo".
Opy will obfuscate the '--foo' string and the .foo attribute without binding them. Workaround: A) Convert args to a dictionary
or
Then, access the value via the the key:
B) Access the "magic" attribute via getattr
|
You're welcome, @javadba. Checkout my last suggestion to. It may actually be better for Named Tuples. |
When trying to use a namedtuple the attributes are not matching up:
Original:
Obfsucated:
Result:
AttributeError: 'Arg' object has no attribute 'l11111l_opy_'
The text was updated successfully, but these errors were encountered: