Re: PEP 572 -- Assignment Expressions

2018-11-27 Thread bob gailer
On 11/27/2018 5:48 AM, Ivo Shipkaliev wrote: Hello. Maybe it's too late for a discussion, but I just couldn't resist. I just found out about this new ":=" operator. I need to ask: What is the need for this additional ":" to the "="? Did you read the PEP? It answers the question.

Re: [Tutor] Error Python version 3.6 does not support this syntax.

2018-11-27 Thread Mats Wichmann
On 11/27/18 5:50 AM, srinivasan wrote: > Dear Python Experts, > > As still I am newbie and learning python, I am trying to reuse the > Bluetoothctl wrapper in Python from the link ( > https://gist.github.com/egorf/66d88056a9d703928f93) I am using python3.6 > version, In pycharm editor on the bold

Re: PEP 572 -- Assignment Expressions

2018-11-27 Thread Chris Angelico
On Wed, Nov 28, 2018 at 4:38 AM Ivo Shipkaliev wrote: > >Hello. >Maybe it's too late for a discussion, but I just couldn't resist. >I just found out about this new ":=" operator. I need to ask: > >What is the need for this additional ":" to the "="? >Why: > if (match :

PEP 572 -- Assignment Expressions

2018-11-27 Thread Ivo Shipkaliev
Hello. Maybe it's too late for a discussion, but I just couldn't resist. I just found out about this new ":=" operator. I need to ask: What is the need for this additional ":" to the "="? Why: if (match := pattern.search(data)) is not None: # Do something wit

Re: Error Python version 3.6 does not support this syntax.

2018-11-27 Thread Terry Reedy
On 11/27/2018 8:24 AM, Frank Millman wrote: In the line 'return None',  it may be complaining that None is superfluous - a plain 'return' does the same thing. PEP 8 recommends explicit 'return None' if elsewhere in the function there is an explicit 'return something', as in if condition

Re: Error Python version 3.6 does not support this syntax.

2018-11-27 Thread Terry Reedy
On 11/27/2018 7:50 AM, srinivasan wrote: Dear Python Experts, As still I am newbie and learning python, I am trying to reuse the Bluetoothctl wrapper in Python from the link ( https://gist.github.com/egorf/66d88056a9d703928f93 Created in 2015 ) I am using python3.6 version, In pycharm editor

Re: Error Python version 3.6 does not support this syntax.

2018-11-27 Thread Frank Millman
"srinivasan" wrote in message news:cafstbwec-ww7agrwtotk5z8fhlrfa1hocoobkv7bcyds1be...@mail.gmail.com... As still I am newbie and learning python, I am trying to reuse the Bluetoothctl wrapper in Python from the link ( https://gist.github.com/egorf/66d88056a9d703928f93) I am using python3.6 ve

Re: Error Python version 3.6 does not support this syntax.

2018-11-27 Thread Brian Oney via Python-list
On Tue, 2018-11-27 at 13:50 +0100, srinivasan wrote: > > *except BluetoothctlError, e:* > I don't have python3.6 available, but I believe the proper syntax is: except BluetoothctlError as e: print(e) See: https://docs.python.org/3/tutorial/errors.html?highlight=exception HTW -- h

Error Python version 3.6 does not support this syntax.

2018-11-27 Thread srinivasan
Dear Python Experts, As still I am newbie and learning python, I am trying to reuse the Bluetoothctl wrapper in Python from the link ( https://gist.github.com/egorf/66d88056a9d703928f93) I am using python3.6 version, In pycharm editor on the bold highlighted code snippets I see the error message "

Re: Question on difference between LambdaType and FunctionType

2018-11-27 Thread Iwo Herka
Ian Kelly wrote: > What about: > > __init__ = lambda self: setattr(self, 'foo', 'bar') That's an edge-case alright. Fortunately, I've decided to not skip lambdas. That's too problematic, it's easier to parse them as a special-case. Thanks for pointing this out. Sincerely, Iwo Herka -- https