Good day for everyone.
I have new asyncio project which use aiohttp connector and asyncio
protocols/transports for tunneling packets through Tor Network cleanly.
Project called aiotor: https://github.com/torpyorg/aiotor
If someone with experience in asyncio field can make code review I will
Good day everyone.
I have new asyncio project which use aiohttp connector and asyncio
protocols/transports for tunneling packets through Tor Network cleanly.
Project called aiotor: https://github.com/torpyorg/aiotor
If someone with experience in asyncio field can make code review I will
be
2018-04-18 12:41 GMT+02:00 Albert-Jan Roskam :
> Hi,
>
> I am writing my first unittests for a Flask app. First modest goal is to
> test whether a selected subset of the templates return the expected status
> 200.
> I am using a nose test generator in a class for this. Is the code below
> the corr
Hi,
I am writing my first unittests for a Flask app. First modest goal is to test
whether a selected subset of the templates return the expected status 200.
I am using a nose test generator in a class for this. Is the code below the
correct way to do this? And is there a way to dynamically set
>> 15
>> multiline=is_multi_lines)
>>
>
> No need to set multiline = ... when is_multiline is already defined
Watch for word wrap. He sets the argument for the “multiline” parameter in
the measure.get_font_metrics() method call from the “is_multi_lines”
para
Hello List Members,
I am beginning to learn Python, and I've adapted some code from Google
into the function below. I'm also looking at the PEP 8 style guide. I'd
appreciate a brief code review so I can start this journey off on a solid
foundation. :)
* I've alrea
Hello List Members,
I am beginning to learn Python, and I've adapted some code from Google
into the function below. I'm also looking at the PEP 8 style guide. I'd
appreciate a brief code review so I can start this journey off on a solid
foundation. :)
* I've alrea
n below. I'm also looking at the PEP 8 style guide.
> I'd appreciate a brief code review so I can start this journey off on
> a solid foundation. :)
>
> * I've already changed my editor from tabs to 4 spaces.
> * I've also set my editor to a
On Mon, Dec 7, 2015 at 4:34 AM, Joel Goldstick wrote:
>> 5 if (desired_text != '') and \
>> 6 (desired_font_family != '') and \
>> 7 (desired_font_size != '') and \
>> 8 ((is_multi_lines == "True") or (is_multi_lines == "False")):
>>
>
> The above test will always
n below. I'm also looking at the PEP 8 style guide. I'd
> appreciate a brief code review so I can start this journey off on a solid
> foundation. :)
>
> * I've already changed my editor from tabs to 4 spaces.
> * I've also set my editor to alert me at
eciate
a brief code review so I can start this journey off on a solid foundation. :)
* I've already changed my editor from tabs to 4 spaces.
* I've also set my editor to alert me at 72 characters and don't exceed 79
characters.
* I've named the function and va
On Wed, 2 Sep 2015 19:06 Steven D'Aprano wrote:
Howdy,
I have a utility function for performing atomic file saves, and I'd like to
ask for a code review and comments.
I have published this on ActiveState:
https://code.activestate.com/recipes/579097-safely-and-atomically-write
Howdy,
I have a utility function for performing atomic file saves, and I'd like to
ask for a code review and comments.
I have published this on ActiveState:
https://code.activestate.com/recipes/579097-safely-and-atomically-write-to-a-file/
under an MIT licence. You should read the ve
- Original Message -
> From: "C Smith"
> I read that with 2.7 that I had to initialize class variables to
> immutable types. I think because I was working with the lists before
> they had been altered and were still empty lists. I will mess around
> tomorrow with the classes you suggested
>Jean-Michel wrote:
>replace
> if left_to_act is None:
>left_to_act = []
> self.left_to_act = left_to_act
>by
> self.left_to_act = left_to_act or []
I read that with 2.7 that I had to initialize class variables to
immutable types. I think because I was working with the lists before
they had
On Tuesday, November 4, 2014 12:35:32 PM UTC-8, John Gordon wrote:
> C Smith writes:
>
> > I was wondering if I could get some feedback on the biggest thing I
> > have done as an amateur Python coder.
>
> Comments.
>
> You need a *lot* more comments.
>
> Like, every line or two of code should
C Smith writes:
> I was wondering if I could get some feedback on the biggest thing I
> have done as an amateur Python coder.
Comments.
You need a *lot* more comments.
Like, every line or two of code should have a comment explaining what is
being accomplished. Seriously. Every line or two.
- Original Message -
> From: "C Smith"
> To: python-list@python.org
> Sent: Tuesday, 4 November, 2014 4:28:33 PM
> Subject: Code review
>
> I was wondering if I could get some feedback on the biggest thing I
> have done as an amateur Python coder. The sid
I was wondering if I could get some feedback on the biggest thing I
have done as an amateur Python coder. The sidepots algorithm isn't
correct yet, but I haven't worked on it in a while and thought I would
get some advice before diving back in.
import random, os
###
On 10/14/2014 01:04 AM, Revenant wrote:
Hi all!
I'm new to Python and programming in general, and am trying to learn as much as
I can about it.
Anyway, for a basic first program I made a simple game of Paper, Rock,
Scissors. For this program, I incorporated a main menu that presented three
d
= draws = 0
def instructions():
def about():
def score():
def again(): # which will return True or False, as per Dave's suggestion
def play():
def menu():
print("Welcome")
menu()
When someone comes looking at a program like this, s/he can see
exactly what depends on what. There can be exceptions, of course
(sometimes mutual recursion really is the right thing to do,
especially with tree-walking routines), but those can then be noted
with comments ("Mutually recursive with xyz()."), or in some cases may
be obvious from the names. In any case, the bulk of most programs can
be written in this style, and it does improve clarity.
Hope that's of value. Like all advice, it's just one person's opinion,
and you're most welcome to reject it; but you did ask for code review,
so I'm hoping you'll at least know *why* you're rejecting any piece of
advice :) All the best!
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Hi there! Welcome to Python.
On Tuesday, 14 October 2014 09:04:51 UTC+1, Revenant wrote:
> I am new to Python and would also like to see if any of you programming
> gurus have some suggestions about how I can simplify code, and also if
> there are any other good starter programs to work on to i
Hi all!
I'm new to Python and programming in general, and am trying to learn as much as
I can about it.
Anyway, for a basic first program I made a simple game of Paper, Rock,
Scissors. For this program, I incorporated a main menu that presented three
different options, allowed the user to pla
On Tue, Jan 14, 2014 at 6:22 PM, Bob Martin wrote:
> Does any Linux distro ship with Python 3? I haven't seen one.
On most Debian-based distros, you can simply 'apt-get install
python3', and you'll get some 3.x version (in Debian Squeeze, that's
3.1, Debian Wheezy packages 3.2; Ubuntu since Rari
On 14-01-2014 11:22, Bob Martin wrote:
in 714500 20140113 233415 Chris Angelico wrote:
On Tue, Jan 14, 2014 at 7:43 AM, Steven D'Aprano wrote:
On Tue, 14 Jan 2014 03:40:25 +1100, Chris Angelico wrote:
Incidentally, is there a reason you're using Python 2.6? You should be
able to upgrade at
in 714500 20140113 233415 Chris Angelico wrote:
>On Tue, Jan 14, 2014 at 7:43 AM, Steven D'Aprano wrote:
>> On Tue, 14 Jan 2014 03:40:25 +1100, Chris Angelico wrote:
>>
>>> Incidentally, is there a reason you're using Python 2.6? You should be
>>> able to upgrade at least to 2.7, and Flask ought
On Tue, Jan 14, 2014 at 7:43 AM, Steven D'Aprano wrote:
> On Tue, 14 Jan 2014 03:40:25 +1100, Chris Angelico wrote:
>
>> Incidentally, is there a reason you're using Python 2.6? You should be
>> able to upgrade at least to 2.7, and Flask ought to work fine on 3.3
>> (the current stable Python). If
On Tue, 14 Jan 2014 03:40:25 +1100, Chris Angelico wrote:
> Incidentally, is there a reason you're using Python 2.6? You should be
> able to upgrade at least to 2.7, and Flask ought to work fine on 3.3
> (the current stable Python). If it's the beginning of your project, and
> you have nothing bin
On Tue, Jan 14, 2014 at 3:29 AM, Adam wrote:
> Hey all. New to the list. I’m working on a web app with 2.6 and Flask. I’m
> still relatively new to python. Is there a chance to get a code review from
> anyone? I really want someone to just tear up my code and tell me how to
>
Hey all. New to the list. I’m working on a web app with 2.6 and Flask. I’m
still relatively new to python. Is there a chance to get a code review from
anyone? I really want someone to just tear up my code and tell me how to
increase my efficiency and what I’m doing wrong (and how to upload
On 9/23/2012 9:48 PM, alex23 wrote:
On Sep 23, 6:14 am, "Littlefield, Tyler" wrote:
I've gotten a bit farther into my python mud, and wanted to request
another code review for style and the like.
Are you familiar with codereview.stackexchange.com ?
I actually wasn't, th
On 9/23/2012 9:48 PM, alex23 wrote:
On Sep 23, 6:14 am, "Littlefield, Tyler" wrote:
I've gotten a bit farther into my python mud, and wanted to request
another code review for style and the like.
Are you familiar with codereview.stackexchange.com ?
I actually wasn't, th
On Sep 23, 6:14 am, "Littlefield, Tyler" wrote:
> I've gotten a bit farther into my python mud, and wanted to request
> another code review for style and the like.
Are you familiar with codereview.stackexchange.com ?
(This isn't to dissuade you from posting such r
Hello all:
I've gotten a bit farther into my python mud, and wanted to request
another code review for style and the like. Mainly I'm concerned about
player.py, world.py and components and other ways to handle what I'm
trying to do.
I didn't run pychecker just yet, so ther
In article ,
Duncan Booth wrote:
>Steven D'Aprano wrote:
>
>> On Fri, 13 Jul 2012 12:30:47 +, Albert van der Horst wrote:
>>> The worst of is, of course, = for assignment instead of := . This is
>>> a convention that Python follows, to my dismay.
>>
>> *shrug*
>>
>> The worst is to use = for
Duncan Booth writes:
> Technically of course Python doesn't have assignment, it just binds
> names.
Names, or other references.
I'd argue that Python has assignment, and assignment in Python is
identical with binding references to objects.
But then, the Python documentation refers to “variable
Steven D'Aprano wrote:
> On Fri, 13 Jul 2012 12:30:47 +, Albert van der Horst wrote:
>> The worst of is, of course, = for assignment instead of := . This is
>> a convention that Python follows, to my dismay.
>
> *shrug*
>
> The worst is to use = for both equality and assignment, like some
>
On 7/14/2012 5:26 AM, Ian Kelly wrote:
On Fri, Jul 13, 2012 at 5:09 PM, Terry Reedy wrote:
I believe the following rule is true: if a op b is True or False raises,
Sorry, left out 'or' in 'or raises'
I don't follow. Raises what?
an Exception.
then op is a potentially chained comparis
On Fri, Jul 13, 2012 at 5:09 PM, Terry Reedy wrote:
>
>> From now on, for each operator I would have to remember wether it
>> is a supposedly comparison operator or not.
>
>
> I believe the following rule is true: if a op b is True or False raises,
I don't follow. Raises what?
> then op is a po
From now on, for each operator I would have to remember wether it
is a supposedly comparison operator or not.
I believe the following rule is true: if a op b is True or False raises,
then op is a potentially chained comparison operation. They are (not)
equal (and (not) is), the 4 order compa
On Jul 13, 8:36 pm, Chris Angelico wrote:
> On Sat, Jul 14, 2012 at 1:04 AM, Steven D'Aprano
>
> wrote:
> > Actually, no. Is True less than False, or is it greater? In boolean
> > algebra, the question has no answer. It is only an implementation detail
> > of Python that chooses False < True.
>
>
On Friday, July 6, 2012 9:58:10 AM UTC-4, Steven D'Aprano wrote:
> (Sadly, when I say "we" I mean
> collectively. Many language designers, and programmers, don't have the
> foggiest clue as to what makes a good clean design. Hence C++ and PHP.)
I'm not going to defend C++, but to be fair, a majo
On Sat, Jul 14, 2012 at 1:04 AM, Steven D'Aprano
wrote:
> Actually, no. Is True less than False, or is it greater? In boolean
> algebra, the question has no answer. It is only an implementation detail
> of Python that chooses False < True.
Maybe in boolean algebra, but in code, it's handy to have
On Fri, 13 Jul 2012 12:30:47 +, Albert van der Horst wrote:
>>Apart from Python, Mathematica, Perl 6, CoffeeScript, Cobra and Clay
>>give chained comparisons the standard meaning. It is, or was, a feature
>>request for Boo, but I can't tell whether it has been implemented or
>>not.
>
> Algol
In article <4ff0f8e0$0$29988$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
>On Sun, 01 Jul 2012 05:55:24 -0400, Terry Reedy wrote:
>
>> On 7/1/2012 2:54 AM, Steven D'Aprano wrote:
>>
>>> So no, Python has always included chained comparisons, and yes, it is
>>> shameful that a langua
On Sunday, July 1, 2012 5:48:40 PM UTC+2, Evan Driscoll wrote:
> On 7/1/2012 4:54, Alister wrote:
> > On Sat, 30 Jun 2012 23:45:25 -0500, Evan Driscoll wrote:
> >> If I had seen that in a program, I'd have assumed it was a bug.
> >
> > You would?
> > I have only been using python for 6 - 12 months
On Tue, 03 Jul 2012 23:39:20 -0600
"Littlefield, Tyler" wrote:
> On 7/3/2012 10:55 PM, Simon Cropper wrote:
> > Some questions to Tyler Littlefield, who started this thread.
> >
> > Q1 -- Did you get any constructive feedback on your code?
>
> I did get some, which I appreciated. someone mention
On 04/07/2012 10:29, Paul Rudin wrote:
Mark Lawrence writes:
On 03/07/2012 03:25, John O'Hagan wrote:
On Tue, 3 Jul 2012 11:22:55 +1000
I agree to some extent, but as a counter-example, when I was a child there
a subject called "Weights and Measures" which is now redundant because of the
Met
2012/7/4 Paul Rudin
> Mark Lawrence writes:
>
> > On 03/07/2012 03:25, John O'Hagan wrote:
> >> On Tue, 3 Jul 2012 11:22:55 +1000
> >>
> >> I agree to some extent, but as a counter-example, when I was a child
> there
> >> a subject called "Weights and Measures" which is now redundant because
> o
Mark Lawrence writes:
> On 03/07/2012 03:25, John O'Hagan wrote:
>> On Tue, 3 Jul 2012 11:22:55 +1000
>>
>> I agree to some extent, but as a counter-example, when I was a child there
>> a subject called "Weights and Measures" which is now redundant because of the
>> Metric system. I don't miss ho
On 03/07/2012 22:54, Chris Angelico wrote:
On Wed, Jul 4, 2012 at 6:13 AM, Dave Angel wrote:
On 07/03/2012 12:05 PM, Mark Lawrence wrote:
If I go to the moon I will weigh 2st 10lb (if my sums are correct :)
but the equivalent Frenchman will still be 86kg. I hereby put this
forward as proof tha
>
> It did get me wondering, though, if there's much in the way of support
> for code review in repository sites like github? Being able to
> aggregate comments around the actual code itself could be really
> handy.
--
http://mail.python.org/mailman/listinfo/python-list
:) But yes, it should've been forked into a separate thread
ages okay.
It did get me wondering, though, if there's much in the way of support
for code review in repository sites like github? Being able to
aggregate comments around the actual code itself could be really
handy.
--
http://mail.python.org/mailman/listinfo/python-list
On 7/3/2012 10:55 PM, Simon Cropper wrote:
Some questions to Tyler Littlefield, who started this thread.
Q1 -- Did you get any constructive feedback on your code?
I did get some, which I appreciated. someone mentioned using PyLint.
From reading, I found it was really really pedantic, so I use
On 04/07/12 13:53, Chris Angelico wrote:
On Wed, Jul 4, 2012 at 12:57 PM, wrote:
Well, if you waited until you had the password (however long) in a variable
before you applied your maximum limits, the DoS ship has probably sailed
already.
Only because data transfer is usually more expensiv
On Wed, Jul 4, 2012 at 12:57 PM, wrote:
> Well, if you waited until you had the password (however long) in a variable
> before you applied your maximum limits, the DoS ship has probably sailed
> already.
Only because data transfer is usually more expensive than hashing. But
I'd say that'll alw
Ian Kelly wrote:
>On Tue, Jul 3, 2012 at 11:53 AM, Kushal Kumaran
> wrote:
>> On Sat, Jun 30, 2012 at 3:34 PM, Alister
>wrote:
>>> On Fri, 29 Jun 2012 09:03:22 -0600, Littlefield, Tyler wrote:
>>>
On 6/29/2012 1:31 AM, Steven D'Aprano wrote:
> On Thu, 28 Jun 2012 20:58:15 -0700, alex23
On Wed, Jul 4, 2012 at 6:13 AM, Dave Angel wrote:
> On 07/03/2012 12:05 PM, Mark Lawrence wrote:
>> If I go to the moon I will weigh 2st 10lb (if my sums are correct :)
>> but the equivalent Frenchman will still be 86kg. I hereby put this
>> forward as proof that the metric system is rubbish and w
On Wed, Jul 4, 2012 at 4:27 AM, Ian Kelly wrote:
> On Tue, Jul 3, 2012 at 12:18 PM, John Gordon wrote:
>> As a practical matter, doesn't there have to be *some* sort of limit?
>> For example if the (encrypted) password is stored in a database, you can't
>> exceed the table column width.
>
> Hopef
On 07/03/2012 12:05 PM, Mark Lawrence wrote:
> On 03/07/2012 16:53, Chris Angelico wrote:
>> On Wed, Jul 4, 2012 at 1:50 AM, Mark Lawrence
>> wrote:
>>> On 03/07/2012 03:25, John O'Hagan wrote:
On Tue, 3 Jul 2012 11:22:55 +1000
I agree to some extent, but as a counter-example,
On Tue, Jul 3, 2012 at 12:18 PM, John Gordon wrote:
> In Kushal Kumaran
> writes:
>
>> I haven't actually seen the rest of the code, but I would like to
>> point out that applications placing maximum length limits on passwords
>> are extremely annoying.
>
> As a practical matter, doesn't there
In Kushal Kumaran
writes:
> I haven't actually seen the rest of the code, but I would like to
> point out that applications placing maximum length limits on passwords
> are extremely annoying.
As a practical matter, doesn't there have to be *some* sort of limit?
For example if the (encrypted)
On Tue, Jul 3, 2012 at 11:53 AM, Kushal Kumaran
wrote:
> On Sat, Jun 30, 2012 at 3:34 PM, Alister wrote:
>> On Fri, 29 Jun 2012 09:03:22 -0600, Littlefield, Tyler wrote:
>>
>>> On 6/29/2012 1:31 AM, Steven D'Aprano wrote:
On Thu, 28 Jun 2012 20:58:15 -0700, alex23 wrote:
> On Jun 29
On Sat, Jun 30, 2012 at 3:34 PM, Alister wrote:
> On Fri, 29 Jun 2012 09:03:22 -0600, Littlefield, Tyler wrote:
>
>> On 6/29/2012 1:31 AM, Steven D'Aprano wrote:
>>> On Thu, 28 Jun 2012 20:58:15 -0700, alex23 wrote:
>>>
On Jun 29, 12:57 pm, "Littlefield, Tyler" wrote:
> I was curious if
On 03/07/2012 16:53, Chris Angelico wrote:
On Wed, Jul 4, 2012 at 1:50 AM, Mark Lawrence wrote:
On 03/07/2012 03:25, John O'Hagan wrote:
On Tue, 3 Jul 2012 11:22:55 +1000
I agree to some extent, but as a counter-example, when I was a child there
a subject called "Weights and Measures" which
On 03/07/2012 07:09, Dennis Lee Bieber wrote:
On 03 Jul 2012 04:11:22 GMT, Steven D'Aprano
declaimed the following in
gmane.comp.python.general:
One of my favourites is the league, which in the Middle Ages was actually
defined as the distance that a man, or a horse, could walk in an hour.
On Wed, Jul 4, 2012 at 1:50 AM, Mark Lawrence wrote:
> On 03/07/2012 03:25, John O'Hagan wrote:
>>
>> On Tue, 3 Jul 2012 11:22:55 +1000
>>
>> I agree to some extent, but as a counter-example, when I was a child there
>> a subject called "Weights and Measures" which is now redundant because of
>> t
On 03/07/2012 03:25, John O'Hagan wrote:
On Tue, 3 Jul 2012 11:22:55 +1000
I agree to some extent, but as a counter-example, when I was a child there
a subject called "Weights and Measures" which is now redundant because of the
Metric system. I don't miss hogsheads and fathoms at all.
John
I
On Mon, 2 Jul 2012 22:10:00 -0700 (PDT)
rusi wrote:
> On Jul 3, 7:25 am, John O'Hagan wrote:
> >
> > I agree to some extent, but as a counter-example, when I was a child there
> > a subject called "Weights and Measures" which is now redundant because of
> > the Metric system. I don't miss hogshe
In article ,
Dennis Lee Bieber wrote:
> On 03 Jul 2012 04:11:22 GMT, Steven D'Aprano
> declaimed the following in
> gmane.comp.python.general:
>
>
> > One of my favourites is the league, which in the Middle Ages was actually
> > defined as the distance that a man, or a horse, could walk in a
On 2012-07-02, Chris Angelico wrote:
> On Tue, Jul 3, 2012 at 1:57 AM, Rick Johnson
> wrote:
>> Poor Chris. That's because you've been brainwashed into believing you
>> must spoon feed your interpreter to get your code working correctly.
>> Stop applying these naive assumptions to Python code. Pyt
On Mon, Jul 2, 2012 at 1:35 PM, Rick Johnson
wrote:
> I am reminded of a story: A few years back a very nice old woman
> offered to give me her typewriter. She said: "i might need to type a
> letter one day and it would good to have around". It was a nice
> typewriter for 1956, but she had no idea
rusi writes:
> Similar for standardized languages: Python's indentation is nice --
> except when you have to embed it into say, html
If you can't write a ‘pre’ element for pre-formatted text, you don't
have HTML http://www.w3.org/TR/html401/struct/text.html#h-9.3.4>.
--
\ “Pinky, are you
On Jul 3, 7:25 am, John O'Hagan wrote:
>
> I agree to some extent, but as a counter-example, when I was a child there
> a subject called "Weights and Measures" which is now redundant because of the
> Metric system. I don't miss hogsheads and fathoms at all.
>
> Music is another field which could d
On Tue, 03 Jul 2012 12:25:59 +1000, John O'Hagan wrote:
> On Tue, 3 Jul 2012 11:22:55 +1000
> Chris Angelico wrote:
>
>> On Tue, Jul 3, 2012 at 10:57 AM, Steven D'Aprano
>> wrote:
>>
>> > Perhaps the world would be better off if mathematicians threw out the
>> > existing precedence rules and r
On Tue, 3 Jul 2012 11:22:55 +1000
Chris Angelico wrote:
> On Tue, Jul 3, 2012 at 10:57 AM, Steven D'Aprano
> wrote:
>
> > Perhaps the world would be better off if mathematicians threw out the
> > existing precedence rules and replaced them with a strict left-to-right
> > precedence. (Personally
On Tue, Jul 3, 2012 at 10:57 AM, Steven D'Aprano
wrote:
> On Tue, 03 Jul 2012 02:55:48 +1000, Chris Angelico wrote:
>> Oh yes, absolutely consistent. Consistency. It's a CR 1/2 monster found
>> on page 153 of the 3.5th Edition Monster Manual.
>
> GvR is fond of quoting Ralph Waldo Emerson:
>
> "A
On Tue, 03 Jul 2012 02:55:48 +1000, Chris Angelico wrote:
> On Tue, Jul 3, 2012 at 1:16 AM, Rick Johnson
> wrote:
>> py> 1 + 3 * 4
>> should ALWAYS equal 16!
>>
>> With parenthesis only used for grouping: py> a + (b*c) + d
>>
>> Which seems like the most consistent approach to me.
>
> Oh yes, ab
On Tue, Jul 3, 2012 at 5:06 AM, Thomas Jollans wrote:
> On 07/02/2012 08:22 PM, Rick Johnson wrote:
>> Agreed. I wish we had one language. One which had syntactical
>> directives for scoping, blocks, assignments, etc, etc...
>>
>> BLOCK_INDENT_MARKER -> \t
>> BLOCK_DEDENT_MARKER -> \n
>> STATEMENT
On Jul 2, 2:06 pm, Thomas Jollans wrote:
> On 07/02/2012 08:22 PM, Rick Johnson wrote:
>
> > Agreed. I wish we had one language. One which had syntactical
> > directives for scoping, blocks, assignments, etc, etc...
>
> > BLOCK_INDENT_MARKER -> \t
> > BLOCK_DEDENT_MARKER -> \n
> > STATEMENT_TERMIN
On Sat, Jun 30, 2012 at 2:50 PM, Thomas Jollans wrote:
> Which of the two comparisons is done first anyway?
> "In the face of ambiguity, refuse the temptation to guess."
I would consider that a pro, not a con, because the C-like way is much
worse in this regard. Using operator chaining, is "1 <
On 07/02/2012 08:22 PM, Rick Johnson wrote:
> Agreed. I wish we had one language. One which had syntactical
> directives for scoping, blocks, assignments, etc, etc...
>
> BLOCK_INDENT_MARKER -> \t
> BLOCK_DEDENT_MARKER -> \n
> STATEMENT_TERMINATOR -> \n
> ASSIGNMENT_OPERATOR -> :=
> CONDITIONAL_IF
On Jul 2, 11:42 am, Chris Angelico wrote:
> Rick, do you realize that you have
> to spoon-feed the interpreter with spaces/tabs when other interpreters
> just KNOW to drop back an indentation level when you close a brace?
Yes. And significant white space is my favorite attribute of Python
source
On Tue, Jul 3, 2012 at 1:16 AM, Rick Johnson
wrote:
> py> 1 + 3 * 4
> should ALWAYS equal 16!
>
> With parenthesis only used for grouping:
> py> a + (b*c) + d
>
> Which seems like the most consistent approach to me.
Oh yes, absolutely consistent. Consistency. It's a CR 1/2 monster
found on page 1
On Jun 30, 9:06 pm, Steven D'Aprano wrote:
> On Sun, 01 Jul 2012 00:05:26 +0200, Thomas Jollans wrote:
> > Yes. My sole point, really, is that "normally", one would expect these
> > two expressions to be equivalent:
>
> > a < b < c
> > (a < b) < c
>
> Good grief. Why would you expect that?
>
> You
On Tue, Jul 3, 2012 at 1:57 AM, Rick Johnson
wrote:
> Poor Chris. That's because you've been brainwashed into believing you
> must spoon feed your interpreter to get your code working correctly.
> Stop applying these naive assumptions to Python code. Python knows
> when you reach the end of a stat
On Jul 2, 3:20 am, Chris Angelico wrote:
> On Mon, Jul 2, 2012 at 6:11 PM, Steven D'Aprano
>
> wrote:
> > "c" < first_word < second_word == third_word < "x"
>
> > I'm sure I don't have to explain what that means -- that standard chained
> > notation for comparisons is obvious and simple.
>
> > In
On 7/2/2012 1:20 AM, Dennis Lee Bieber wrote:
Obviously, someone coming over from VB or R
or any other single language x
who hasn't read the Python reference is going to
be surprised as something or other. So what. The manuals, including the
tutorial, are there for a reason. The main poin
On 07/02/2012 03:28 AM, Steven D'Aprano wrote:
> We *really did have* somebody arguing that chained comparisons are Bad
> because you can't stick parentheses around bits of it without changing
> the semantics. That was an actual argument, not a straw-man.
Ahem. It may have been sub-optimally phr
On 07/02/2012 02:43 AM, Steven D'Aprano wrote:
> On Sun, 01 Jul 2012 09:35:40 +0200, Thomas Jollans wrote:
>> This is simply wrong. The comparisons are not acting as binary
>> operators.
>
> Of course they are. Take this chained comparison:
Technically, yes - two-input operations are happening. S
On Mon, Jul 2, 2012 at 6:11 PM, Steven D'Aprano
wrote:
> "c" < first_word < second_word == third_word < "x"
>
> I'm sure I don't have to explain what that means -- that standard chained
> notation for comparisons is obvious and simple.
>
> In Python, you write it the normal way, as above. But some
On Mon, 02 Jul 2012 12:04:29 +1000, Chris Angelico wrote:
>> Chained comparisons in the Python sense may be rare in computer
>> languages, but it is the standard in mathematics and hardly needs to be
>> explained to anyone over the age of twelve. That is a terrible
>> indictment on the state of pr
On Sun, 01 Jul 2012 21:50:29 -0400, Devin Jeanpierre wrote:
> On Sun, Jul 1, 2012 at 9:28 PM, Steven D'Aprano
> wrote:
>> Technically, < in Python is left-associative: a < b < c first evaluates
>> a, not b or c. But it is left-associative under the rules of comparison
>> operator chaining, not ar
On Sun, 01 Jul 2012 13:41:20 -0400
Dennis Lee Bieber wrote:
> I'd think a true newcomer (to programming) would have NO
> expectations... And if they'd had any complex math classes may actually
> consider
> if 1 < x < 10:
> to be the norm
[...]
+1
I've only ever known Pyth
On Mon, Jul 2, 2012 at 11:28 AM, Steven D'Aprano
wrote:
> On Sun, 01 Jul 2012 16:33:15 +1000, Chris Angelico wrote:
>
>> On Sun, Jul 1, 2012 at 4:27 PM, Steven D'Aprano
>> wrote:
>>> Yes, you can find specially crafted examples where adding parentheses
>>> in certain places, but not others, doesn
On Sun, Jul 1, 2012 at 9:28 PM, Steven D'Aprano
wrote:
> Technically, < in Python is left-associative: a < b < c first evaluates
> a, not b or c. But it is left-associative under the rules of comparison
> operator chaining, not arithmetic operator chaining.
Left-associativity is when a < b < c is
On Sun, Jul 1, 2012 at 8:41 PM, Steven D'Aprano
wrote:
> On Sun, 01 Jul 2012 05:18:09 -0400, Devin Jeanpierre wrote:
> Sheesh guys. Don't go hunting through the most obscure corners of
> mathematics for examples of computer scientists who have invented their
> own maths notation. (Which, by your o
On Sun, 01 Jul 2012 16:33:15 +1000, Chris Angelico wrote:
> On Sun, Jul 1, 2012 at 4:27 PM, Steven D'Aprano
> wrote:
>> Yes, you can find specially crafted examples where adding parentheses
>> in certain places, but not others, doesn't change the overall
>> evaluation of the expression.
>
> My p
On Sun, 01 Jul 2012 05:55:24 -0400, Terry Reedy wrote:
> On 7/1/2012 2:54 AM, Steven D'Aprano wrote:
>
>> So no, Python has always included chained comparisons, and yes, it is
>> shameful that a language would force you to unlearn standard notation
>> in favour of a foolish consistency with other
On Sun, 01 Jul 2012 09:35:40 +0200, Thomas Jollans wrote:
> On 07/01/2012 04:06 AM, Steven D'Aprano wrote:
>> On Sun, 01 Jul 2012 00:05:26 +0200, Thomas Jollans wrote:
>>
>>> As soon as you read it as a ternary operator,
>>
>> Well that's your problem. Why are you reading it as a ternary operato
1 - 100 of 229 matches
Mail list logo