-
Notifications
You must be signed in to change notification settings - Fork 1
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
Getting error TypeError: unsupported operand type(s) for &: 'list' and 'list' #13
Comments
Hi @sbansal6. Sorry for taking a bit to reply on this. I had a busy few days, and this is a hobby project for me. I'm having trouble reproducing the How are you running the code above? Did you copy and paste it from the GitHub page? And how have you installed Fang? Do you install Fang with The repository contains a copy of the example code in If I run that in my terminal, I get output like:
The example code just outputs I'm happy to help you debug the problem further. Would you mind posting what operating system you're using (Windows, macOS, Linux)? And the output of |
@sbansal6 Are you running this with Python 2? |
yes , i am using python 2.7
…On Feb 19, 2017 4:15 PM, "Nathan Craike" ***@***.***> wrote:
@sbansal6 <https://github.com/sbansal6> Are you running this with Python
2?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB2DZ5V7Mwr_gmDt7lHlnZOY5ohJKdwcks5reNsHgaJpZM4L_1iB>
.
|
Okay. Fang actually requires Python 3.4 or later. I expected that the packaging settings I have in setup.py would prevent you installing Fang on Python 2.7, but maybe that is not the case. How did you install Fang on your system? |
Running the example code:-
import fang
di = fang.Di(namespace='.com.example.myproject')
@di.dependsOn('multiplier')
def multiply(n):
'''Multiply the given number n by some configured multiplier.'''
multiplier = di.resolver.unpack(multiply)
return multiplier * n
providers = fang.ResourceProviderRegister(namespace='.com.example.myproject')
@providers.register('multiplier')
def give_multiplier():
'''Give a multiplier of 2.'''
return 2
def main():
# Here at our program entry-point, we configure what set of providers
# will be used to meet our dependencies
di.providers.load(providers)
# Prints 10
print(multiply(5))
if name == 'main':
main()
The text was updated successfully, but these errors were encountered: