On Thu, Mar 2, 2017 at 11:04 AM, Barry Warsaw wrote:
> On Mar 01, 2017, at 03:04 PM, Mathieu BEAL wrote:
>
>>I was wondering why the PEP coding style (
>>https://www.python.org/dev/peps/pep-0008/) is not natively included in python
>>grammar ?
>
> Well, the simple answer is that
On Mar 01, 2017, at 03:04 PM, Mathieu BEAL wrote:
>I was wondering why the PEP coding style (
>https://www.python.org/dev/peps/pep-0008/) is not natively included in python
>grammar ?
Well, the simple answer is that the grammar predates PEP 8 (or any PEP) by
many years.
Cheers,
-Barry
On 28 February 2017 at 23:19, Victor Stinner
wrote:
> 2017-02-28 13:17 GMT+01:00 Michel Desmoulin :
> > We have the immutable frozenset for sets and and tuples for lists.
> >
> > But we also have something to manipulate dict as immutable
>
On 1 March 2017 at 01:31, qhlonline wrote:
> My code example is not proper, Yes, may be this is better:
> list.sort().revers(
We can already do this - reversed(sorted(lst))
This is a long-established design decision in Python. It would need a
*very* compelling use case to
I know what the regulars among you will be thinking (time machine, high
bar for language syntax changes, etc.) so let me start by assuring you
that I'm well aware of all of this, that I did research the topic before
posting and that this is not the same as a previous suggestion using
almost
On Wed, Mar 1, 2017 at 2:31 AM, Nicolas Cellier
wrote:
> For example:
>
>> lazy import pylab as pl # do nothing for now
>>
>> # do stuff
>>
>> def plot(*args):
>> pl.figure() # Will raise an ImportError at this point
>> pl.plot(...)
This can already be
On 01/03/17 02:56, 语言破碎处 wrote:
I'm bited once:
>>> '' in {} == False
False
>>> ('' in {}) == False
True
# '' in {} == False ==>> ('' in {}) and ({} == False) ==>> False!
I think only compare operations should be chained.
I think comparing against False (or True) is bad
> On 2017 Mar 1 , at 4:37 a, Wolfgang Maier
> wrote:
>
> I know what the regulars among you will be thinking (time machine, high bar
> for language syntax changes, etc.) so let me start by assuring you that I'm
> well aware of all of this, that I did
I was wondering why the PEP coding style (
https://www.python.org/dev/peps/pep-0008/) is not natively included in
python grammar ?
For instance, both, *function definition* and *class definition*, are using
the same “NAME” token. ((see,
https://docs.python.org/3/reference/grammar.html).
Long story short, it's because there can be good reasons to ignore PEP8
naming conventions. Linting tools can be taught to skip over an
intentional PEP8 violation. A grammar rule can't
Alex
On 2017-03-01 09:04 AM, Mathieu BEAL wrote:
>
> I was wondering why the PEP coding style
>
On 1 March 2017 at 13:50, Steven D'Aprano wrote:
> It is possible that we could come up with a pretty-printing protocol,
> but that wouldn't be a trivial job.
I'd be inclined to do this via simplegeneric. Let pprint do what it
currently does, but allow users to register
> On Mar 1, 2017, at 9:35 AM, Paul Moore wrote:
>
>> On 1 March 2017 at 13:50, Steven D'Aprano wrote:
>> It is possible that we could come up with a pretty-printing protocol,
>> but that wouldn't be a trivial job.
>
> I'd be inclined to do this via
Going through machinations to satisfy PEP 8 makes no sense -- it's s style
*guide* -- that's it.
-CHB
On Tue, Feb 28, 2017 at 3:31 PM, Nicolas Cellier <
cont...@nicolas-cellier.net> wrote:
> I have seen some interest into lazy functionality implementation.
>
> I wondered if it can be linked
On 3/1/17, Steven D'Aprano wrote:
> On Wed, Mar 01, 2017 at 07:02:23AM +0800, 语言破碎处 wrote:
>>
>> where we use types?
>> almost:
>> isinstance(obj, T);
>> # issubclass(S, T);
>>
>> Note that TYPE is SET;
>
> What does that mean? I don't understand.
Maybe
On 1 March 2017 at 19:37, Wolfgang Maier <
wolfgang.ma...@biologie.uni-freiburg.de> wrote:
> I know what the regulars among you will be thinking (time machine, high
> bar for language syntax changes, etc.) so let me start by assuring you that
> I'm well aware of all of this, that I did research
On Wed, Mar 1, 2017 at 2:16 PM, אלעזר wrote:
> I like the idea, but I wanted to note that since it has no meaning from
> the point of view of the defined function, it can be done with a magic
> decorator, so new syntax is not required:
>
> @positional_only[:4]
> def
On Tue, Feb 28, 2017 at 03:35:31PM -0800, Jelle Zijlstra wrote:
> 2017-02-28 15:12 GMT-08:00 Steven D'Aprano :
> > On Wed, Mar 01, 2017 at 07:02:23AM +0800, 语言破碎处 wrote:
> >>
> >> where we use types?
> >> almost:
> >> isinstance(obj, T);
> >> #
A crucial difference between a set and a type is that you cannot
explicitly iterate over the elements of a type, so while we could implement
x in int
to do something useful, we cannot make
for x in int:
print(x)
Because if we could, we could implement Russell's paradox in Python:
R = set(x
On Tue, Feb 28, 2017 at 5:26 PM, Michel Desmoulin wrote:
> Duck typing is precesily about incomplete but good enough similar API.
>
yes, though ideally one API is a subset of the other -- if they have the
same method, it should mean the same thing:
> For the dict
On 03/01/2017 01:37 AM, Wolfgang Maier wrote:
Now here's the proposal: allow an except (or except break) clause to follow
for/while loops that will be executed if the
loop was terminated by a break statement.
I find the proposal interesting. More importantly, the proposal is well
written
>From my experience teaching Python to non-programmers, it's a huge
hurdle/nightmare to teach functions/methods that modify objects in-place
vs. return a value that must be reassigned. Behold Pandas's DataFrame's
sort method, which has an optional `in_place` argument that defaults to
*False*,
Definitively not, just like M. Fowler: "Meyer likes to use command-query
separation absolutely, but there are exceptions. Popping a stack is a good
example of a query that modifies state. Meyer correctly says that you can
avoid having this method, but it is a useful idiom. So I prefer to follow
On Tue, Feb 28, 2017 at 5:56 PM, Michel Desmoulin wrote:
> Me, I have to deal SOAP government systems, mongodb based API built by
> teenagers, geographer data set exports and FTP + CSV in marina systems
> (which I happen to work on right now).
>
> 3rd party CSV, XML
On 28.02.17 23:17, Victor Stinner wrote:
My question is: would it make sense to implement this feature in
Python directly? If yes, what should be the syntax? Use "/" marker?
Use the @positional() decorator?
I'm strongly +1 for supporting positional-only parameters. The main
benefit to me is
On Wed, Mar 1, 2017 at 11:25 AM, Serhiy Storchaka
wrote:
> On 28.02.17 23:17, Victor Stinner wrote:
>
>> My question is: would it make sense to implement this feature in
>> Python directly? If yes, what should be the syntax? Use "/" marker?
>> Use the @positional()
On 03/01/2017 11:53 AM, Guido van Rossum wrote:
FWIW in typeshed we've started using double leading underscore as a convention
for positional-only parameters, e.g. here:
https://github.com/python/typeshed/blob/master/stdlib/3/builtins.pyi#L936
I would much rather have a single '/' to denote
On 3/1/2017 12:26 PM, Stéfane Fermigier wrote:
What I wanted to point out is that the paragraph quoted by Stephan ("In
general in Python (and in all cases in the standard library) a method
that mutates an object will return None to help avoid getting the two
types of operations confused. So if
On 2017-03-01 21:32, Ethan Furman wrote:
On 03/01/2017 11:53 AM, Guido van Rossum wrote:
FWIW in typeshed we've started using double leading underscore as a convention
for positional-only parameters, e.g. here:
https://github.com/python/typeshed/blob/master/stdlib/3/builtins.pyi#L936
I
On Wed, Mar 1, 2017 at 9:26 PM Serhiy Storchaka wrote:
> On 28.02.17 23:17, Victor Stinner wrote:
> > My question is: would it make sense to implement this feature in
> > Python directly? If yes, what should be the syntax? Use "/" marker?
> > Use the @positional() decorator?
29 matches
Mail list logo