We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
class SimpleVariable: def __init__(self): self._value = '' def __lshift__(self,val): self._value = val def __repr__(self): return '<%s>' % self._value
I implemented << operator for variable class, it maybe makes code looks better:
<<
def personWithSimpleVariable(Person): Person << 'Alpha' ; yield Person Person << 'Beta' ; yield Person Person << 'Gamma' ; yield Person
I also return binded variable, not just false like it done in original -- it looks more logical. In result prints looks like:
false
P = Var() ; print P for p in Persons(P): print p
<> <Alpha> <Beta> <Gamma>
First print returns unbinded variable, maybe it should looks differ then binded?
The text was updated successfully, but these errors were encountered:
More logical, shows unbinded w/o <>:
<>
class Var: def __init__(self): self._value = None def __repr__(self): if self._value: return '<%s>' % self._value else: return str(self._value)
None <Alpha> <Beta> <Gamma>
Sorry, something went wrong.
No branches or pull requests
I implemented
<<
operator for variable class, it maybe makes code looks better:I also return binded variable, not just
false
like it done in original -- it looks more logical.In result prints looks like:
First print returns unbinded variable, maybe it should looks differ then binded?
The text was updated successfully, but these errors were encountered: