Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-27 Thread Greg
As I introduced (a long time ago) this demand, let me add my grain of salt here. The use case is pretty simple, and somewhat common when writing manually C extension class: The reason to write extension class is usually performance, or link into an existing library. When doing this manually (inste

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-28 Thread Greg
e a heap type? > > On Wed, Jun 27, 2018 at 2:05 AM Greg wrote: > >> As I introduced (a long time ago) this demand, let me add my grain of >> salt here. >> >> The use case is pretty simple, and somewhat common when writing manually >> C extension class: The reaso

[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-16 Thread Greg Ewing
ject and call it later, with the same effect as if I'd called it directly. I wouldn't want that to change. Fortunately, it never will, because changing it now would break huge amounts of code. -- Greg ___ Python-ideas mailing list -- python-id

[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-17 Thread Greg Ewing
t see how we can get any more in this area than we already have, without making (a.b)() have different semantics from a.b() -- which is extremely unlikely to to ever happen. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe sen

[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-17 Thread Greg Ewing
e strict mode doesn't really make any "revolutionary" changes. It just exposes, emphasizes, and makes consistent, the properties Python language already has. Ain't that cute? Do you spot any issues, Greg? So you *don't* intend to make any semantic changes? I'm sti

[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-17 Thread Greg Ewing
On 18/12/20 1:52 am, Paul Sokolovsky wrote: On Fri, 18 Dec 2020 01:23:34 +1300 Greg Ewing wrote: On 17/12/20 11:25 pm, Paul Sokolovsky wrote: a) (a.b)() syntax b) apply() being resurrected I can't answer that without knowing what alternative semantics you have in mind for (a.b)()

[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-17 Thread Greg Ewing
import random n = random.choice([1,2,3]) would have to be written: import random n = (random.choice)([1,2,3]) I would find that quite unpleasant. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas-l

[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-17 Thread Greg Ewing
A() def f(x, y): return x.choice(y) print(f(random, [1, 2])) print(f(a, ["buckle", "my shoe"])) How much of this is allowed under your restricted semantics? -- Greg ___ Python-ideas mailing list -- [email protected] T

[Python-ideas] Re: Standalone bool?

2020-12-21 Thread Greg Ewing
minimally disruptive when True and False were first introduced, It would have been just as disruptive back then -- that's the reason bool was made a subclass of int in the first place. -- Greg ___ Python-ideas mailing list -- [email protected]

[Python-ideas] Re: Unpack operator "**" and Mapping

2020-12-26 Thread Greg Ewing
() method that returns an iterable (pf pairs of objects). It seems to me it would be more fundamental to use iteration to get the keys and indexing to get the corresponding values. You're only relying on dunder methods then. -- Greg ___ Python-ideas ma

[Python-ideas] Re: Unpack operator "**" and Mapping

2020-12-26 Thread Greg Ewing
On 27/12/20 3:03 pm, Chris Angelico wrote: But that would mean that a lot of iterables would look like mappings when they're not. In the context of ** you're expecting a mapping, not a sequence. -- Greg ___ Python-ideas mailing list -- py

[Python-ideas] Re: Unpack operator "**" and Mapping

2020-12-29 Thread Greg Ewing
y more akin to the infamous "file-like object" which is whatever it needs to be for the purpose at hand? Guido has since said that the ABCs are intended to be definitive, but the docs don't really make that clear either. (And the ABC doc page talks about "APIs", not "proto

[Python-ideas] Re: Unpack operator "**" and Mapping

2020-12-29 Thread Greg Ewing
t -- there are other syntactic situations that use the iterator protocol, e.g. unpacking assignments. But there should at least be links to it from all the places it's used. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscrib

[Python-ideas] Re: Standard tool for iterating over recursive data structures?

2021-01-01 Thread Greg Ewing
t think so. All the logic for dealing with cycles is buried inside pickle -- __getstate__ just gets info about one object. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas-le...@python

[Python-ideas] Re: Support reversed(itertools.chain(x, y, z))

2021-01-08 Thread Greg Ewing
))) Making `reversed(itertools.chain(x, y, z))` do this would be a backwards incompatible change. Also it's hard to see how it could be made to work, because the argument to reversed() necessarily has to be a sequence, not an iterator. -- Greg ___ Python-

[Python-ideas] Re: Support reversed(itertools.chain(x, y, z))

2021-01-08 Thread Greg Ewing
into sequences of characters: >>> list(itertools.chain("abc", "def")) ['a', 'b', 'c', 'd', 'e', 'f'] -- Greg ___ Python-ideas mailing list -- python-ideas@py

[Python-ideas] Re: List .index() Method

2021-01-29 Thread Greg Ewing
with *specification*. How is it supposed to know when you want a negative index without reading your mind? -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.pyth

[Python-ideas] Re: Conditional with statements

2021-02-07 Thread Greg Ewing
to indent by 4 spaces. I often write Python with 2-space indents, which is quite readable and gives me twice as many indentation levels to play with. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to pytho

[Python-ideas] Re: Arrow functions polyfill

2021-02-15 Thread Greg Ewing
mous functions, so it feels sort of tacked on. I'm not arguing for or against anything here, just exploring possible reasons why the idea of lambda-replacement comes up so often. -- Greg ___ Python-ideas mailing list -- [email protected] To unsu

[Python-ideas] Re: Alternate lambda syntax

2021-02-16 Thread Greg Ewing
a mistake transcribing a mathematics paper many years ago." :-) -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.o

[Python-ideas] Re: Alternate lambda syntax

2021-02-16 Thread Greg Ewing
aning has to be taught in any case, though. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message arc

[Python-ideas] Re: SimpleNamespace vs object

2021-02-17 Thread Greg Ewing
d you get to give it a name that reflects what you're really doing with it. I don't understand why there's such a fascination with things like SimpleNamespace. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe sen

[Python-ideas] Re: Alternate lambda syntax

2021-02-17 Thread Greg Ewing
On 18/02/21 3:38 am, MRAB wrote: So a "byte" is part of a word (a word contains multiple characters). In the Burroughs B6900 architecture, programs consisted of 48-bit words broken up into 8-bit opcodes called "syllables". -- Greg

[Python-ideas] Re: Alternate lambda syntax

2021-02-18 Thread Greg Ewing
cause Ruby's equivalent of things like the iterator protocol work by passing in a block of code representing the loop body, so having an easy way to write that is important. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscri

[Python-ideas] Re: Integer concatenation to byte string

2021-03-02 Thread Greg Ewing
On 2/03/21 7:01 am, [email protected] wrote: Currently, the only way to concatenate an integer to a bytes object is by converting the integer to bytes with a function call before concatenating. No, it's not: >>> b = bytearray() >>> b.append(42) >>

[Python-ideas] Re: typing.Maybe type annotation

2021-03-10 Thread Greg Werbin
You can also use typing.cast for the handful of cases where your particular type checker (e.g. MyPy) fails to refine the type properly in a case like the following: def lookup_usernames(db, user_ids: Optional[List[int]] = None) -> List[str]: if user_ids is None: return []

[Python-ideas] Re: A shortcut to load a JSON file into a dict : json.loadf

2021-03-10 Thread Greg Werbin
file() would pass along its kwargs to open(), and the user could use lambda, partial, or write a utility function to customize the loader itself. If we are really really leery of adding a new top-level builtin, you could namespace it under a "loadfile" module: from loadfile import lo

[Python-ideas] Re: allow initial comma

2021-03-12 Thread Greg Ewing
Which doesn't help unless the language allows leading commas that are ignored, and I've never seen a language like that. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas-le...@p

[Python-ideas] Re: Multiple dispatch transpilation

2021-03-16 Thread Greg Ewing
tatic analysis can work out what class of object a name refers to, and what methods and attributes it has, it can generate code that is just as efficient. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ide

[Python-ideas] Re: Suggesting feature for python - Big Set, Big Dictionary

2021-03-23 Thread Greg Ewing
y is a thing. If your Python data structure is bigger than your RAM, it will get paged out to disk anyway, so you might not need to do anything. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-id

[Python-ideas] Re: Reverse polish notation

2021-04-02 Thread Greg Ewing
wrote a compiler to translate it into Postscript. The project went much more smoothly after that! -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/m

[Python-ideas] Re: Reverse polish notation

2021-04-02 Thread Greg Ewing
aces. To get by with just one "+" you would need some way to bracket the arguments, then you have something more like backwards Lisp with at least as many parens as infix. -- Greg ___ Python-ideas mailing list -- [email protected] To unsu

[Python-ideas] Re: Reverse polish notation

2021-04-02 Thread Greg Ewing
hose things are obvious at a glance to me from the RPN. Sure, I can figure it all out, but it takes work, and I'm not confident that I haven't made a mistake. Which means I'd much rather audit an infix expression than an RPN one. -- Greg ___

[Python-ideas] Re: Reverse polish notation

2021-04-03 Thread Greg Ewing
here will also have been some kind of mode switch to make it subtract instead of add. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-id

[Python-ideas] Re: Reverse polish notation

2021-04-03 Thread Greg Ewing
On 4/04/21 6:50 am, Chris Angelico wrote: Algebra gives us a HIGHLY compact notation (far too compact to be truly useful in computing, as it's very blackboard/paper oriented) Anyone up for allowing Mathjax in Python source? -- Greg ___ Python-

[Python-ideas] Re: Python Idea - extension of 'with'

2021-04-08 Thread Greg Ewing
se to the file operations, it's usually at a much higher level. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.or

[Python-ideas] Re: Flatten function (was: Deprecate sum of lists)

2021-06-20 Thread Greg Ewing
On 21/06/21 6:04 am, Sebastian Berg wrote: * `flatten()` (alwasy copy) * `ravel()` (copies if needed, and additionally ensures contiguity) * `reshape(-1)` (copies if needed) They are all subtly different, unfortunately. There's also a .flat attribute, that returns a 1-d iterator! --

[Python-ideas] Re: Pre PEP: Python Literals (was custom strings before)

2021-07-05 Thread Greg Ewing
-strings could be confusing. Whereas backticks are currently unused, and they used to nest back when they were used, so giving them a new nesting usage will be unsurprising to those with long enough memories. -- Greg ___ Python-ideas mailing list -- python

[Python-ideas] Re: Pre PEP: Python Literals (was custom strings before)

2021-07-05 Thread Greg Ewing
bbreviated syntax for a parameterless lambda that's only available in template expressions? -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailma

[Python-ideas] Re: Complete recursive pickle dump

2021-08-27 Thread Greg Ewing
just to tell the user to install numpy. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at

[Python-ideas] Re: Add a special TypeError subclass for implementation errors

2021-09-03 Thread Greg Ewing
uthor, so a user error at one level is an implementation error at another. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/p

[Python-ideas] Re: Context manager for csv module 'reader' and 'DictReader'?

2021-09-05 Thread Greg Ewing
manager methods to everything that has open-like functionality. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org

[Python-ideas] Re: Context manager for csv module 'reader' and 'DictReader'?

2021-09-06 Thread Greg Ewing
On 7/09/21 5:46 am, C. Titus Brown via Python-ideas wrote: Maybe Greg missed that DictReader.open didn’t exist and was in fact what I was asking for! Sorry about that, I thought you were asking for context manager methods to be added to an existing file-like object. If csv.DictReader had a

[Python-ideas] Re: Invalidate list iterators after size changes?

2021-10-09 Thread Greg Ewing
. This would break Plex. I use a loop like that as part of the NFA-to-DFA conversion to calculate the epsilon-closure of a state (although obviously there are conditions on adding things to the list that ensure it terminates). -- Greg ___ Python-ideas

[Python-ideas] Re: Parameter tuple unpacking in the age of positional-only arguments

2021-10-26 Thread Greg Werbin
>From a "hobbyist / programming aesthete" perspective, I think this is a great >idea. I think pattern matching in ML-descended languages is wonderfully >elegant. Packing and unpacking tuples is already a common syntactic idiom in >Python, and now that we have Structural Pattern Matching (SPM), i

[Python-ideas] Re: PEP 671: Syntax for late-bound function argument defaults

2021-10-31 Thread Greg Ewing
On 1/11/21 4:59 am, David Mertz, Ph.D. wrote:     b = b I don't want to live in a universe where this could be anything other than a no-op in Python. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an ema

[Python-ideas] Re: Enhancing iterator objects with map, filter, reduce methods

2021-11-22 Thread Greg Ewing
e might want to do with an iterator. Why those particular ones? What about the contents of the itertools module? Should they be included too? Why or why not? -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to

[Python-ideas] Re: Enhancing iterator objects with map, filter, reduce methods

2021-11-26 Thread Greg Ewing
ethods to a protocol late in the life of the language is effectively impossible. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/pyth

[Python-ideas] Re: PEP 671 (late-bound arg defaults), next round of discussion!

2021-12-01 Thread Greg Ewing
On 2/12/21 4:40 am, Paul Moore wrote: the intended use is that people must supply a list[int] or not supply the argument *at all*. I don't think this is a style of API that we should be encouraging people to create, because it results in things that are very awkward to wrap. --

[Python-ideas] Re: inline Python functions and methods

2021-12-08 Thread Greg Ewing
mething that doesn't currently happen. And it can't be done in general-- the location of an imported module isn't know for sure until run time, because changes can be made dynamically to sys.path. -- Greg ___ Python-ideas mailing list -- python-i

[Python-ideas] Re: inline Python functions and methods

2021-12-08 Thread Greg Ewing
elp much in practice. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.pyth

[Python-ideas] Re: Runtime-accessible attribute docstrings – take 2

2021-12-08 Thread Greg Ewing
hat would give you two different ways to document a function, and it seems you could use both of them at the same time, which could be confusing. If you're looking for documentation of a function, there are two places you would have to look -- in the function itself, and in the module where

[Python-ideas] Re: PEP 671 (late-bound arg defaults), next round of discussion!

2021-12-11 Thread Greg Ewing
On 11/12/21 1:22 pm, Christopher Barker wrote: Darn — the P and A are swapped there. "Argument" and "actual" both start with "A" -- does that help? -- Greg ___ Python-ideas mailing list -- [email protected] T

[Python-ideas] Re: inline Python functions and methods

2021-12-11 Thread Greg Ewing
ouldn't have to be changed at all, and programmers wouldn't need to have foresight to decide when to declare things inline. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas-le...@python

[Python-ideas] Re: Revisiting a frozenset display literal

2022-01-16 Thread Greg Ewing
U+2744 Snowflake, anyone? my_frozenset = ❄{1, 2, 3} -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message

[Python-ideas] Re: Revisiting a frozenset display literal

2022-01-18 Thread Greg Ewing
frozenset() on a constant set would immediately benefit from it. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.pyth

[Python-ideas] Re: Revisiting a frozenset display literal

2022-01-18 Thread Greg Ewing
frozenset() on a constant set would immediately benefit from it. -- Greg ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.pyth

[Python-ideas] Re: Allowing non-ASCII bracket and quote characters in source code

2022-01-19 Thread Greg Ewing
sentence, I thought it would be equivalent to [1, 2, 3]? Those particular brackets are really confusing because they're half square and half round. I would expect it to mean [(1, 2, 3)]. -- Greg ___ Python-ideas mailing list -- [email protected]

[Python-ideas] Re: Revisiting a frozenset display literal

2022-01-20 Thread Greg Ewing
assumptions about whether equal frozensets are the same object or not -- just as with ints, strings, etc. It would be just as legitimate e.g. for "ABC".upper() to return the same string object. There is no exception here to be learned. -- Greg ___ Py

[Python-ideas] Re: Allowing non-ASCII bracket and quote characters in source code

2022-01-20 Thread Greg Ewing
On 20/01/22 12:52 pm, Christopher Barker wrote: On Wed, Jan 19, 2022 at 2:12 PM Greg Ewing <mailto:[email protected]>> wrote: Those particular brackets are really confusing because they're half square and half round. And THAT is why this is a bad idea. I

Re: [Python-ideas] PEP 505: None-aware operators

2018-07-25 Thread Greg Ewing
David Mertz wrote: Sorry. From my tablet. "Bug magnets" (it really, really wants to autocorrect that) At least it didn't correct it to "butt magnets". :-) -- Greg ___ Python-ideas mailing list [email protected] https:

Re: [Python-ideas] As-do statements/anonymous blocks in python

2018-07-28 Thread Greg Ewing
if some_other_condition: break If you want to flesh out your proposal you will have to address these. Also you should seek out previous discussions about code blocks to make sure you're not just rehashing old ground. -- Greg Otherwise, call it with no arguments. If you don

Re: [Python-ideas] PEP 505: None-aware operators

2018-07-28 Thread Greg Ewing
normal and expected syntax to use. ?. is much more recent. Maybe in another 30 years, if it has stood the test of time, it could be argued for on the basis of familiarity, but not now. -- Greg ___ Python-ideas mailing list [email protected]

Re: [Python-ideas] Redefining method

2018-07-30 Thread Greg Ewing
. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Syntactic sugar to declare partial functions

2018-08-13 Thread Greg Ewing
considered a part of computers science, because it was invented specifically for the purpose of modelling computation. Set theory wasn't. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas

Re: [Python-ideas] Syntactic sugar to declare partial functions

2018-08-13 Thread Greg Ewing
quot; or something. I don't think that's true. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-15 Thread Greg Ewing
Steve Barnes wrote: * Brakes are used to apply breaking, I hope they actually apply braking, not breaking. :-) * A dinosaur is specifically an extinct terrible (formerly considered) lizard Which technically is not a lizard. -- Greg

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-15 Thread Greg Ewing
Jonathan Fine wrote: Puffinus puffinus is the scientific name for Puff the Magic Dragon? -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-15 Thread Greg Ewing
Alexandre Brault wrote: On 2018-08-15 03:32 PM, MRAB wrote: On 2018-08-15 18:27, MRAB wrote: > While we're at it, what's the only creature that's known commonly and only by its scientific name? I would have guessed Tyrannosaurus Rex I would have thought pretty much any

Re: [Python-ideas] Off topic: 'strike a balance' - second language English

2018-08-21 Thread Greg Ewing
Jonathan Fine wrote: Matlab says: "Here, copy paste this and it'll work". To the point that the workspace is designed to automatically strip >>> from any copy and pasted commands. Maybe this is something Python's REPL should do? -- Greg _

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-22 Thread Greg Ewing
ely recognise what it was doing, or did you have to stop and think about it? -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-22 Thread Greg Ewing
then you won't be surprised when you find a yield in it somewhere. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-22 Thread Greg Ewing
citly described in those terms. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-22 Thread Greg Ewing
n underneath it. That's a technical term and an implementation detail, right there in the user interface! (Never mind that the implentation detail isn't accurate, because the car actually has disc brakes...) -- Greg ___ Python-ideas mailing list Pyth

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-22 Thread Greg Ewing
call them "caret expressions" and write ^(x, y): x + y Nice and quiet! -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-23 Thread Greg Ewing
symbols, so sometimes they have to make a completely arbitrary choice. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-24 Thread Greg Ewing
er, because its grammar is required to be LL(1). If you're interested in this stuff, I recommend either taking a computer science course or reading a good book about the theory of parsing. It will bring a lot of these concepts into sharp focus. -- Greg __

Re: [Python-ideas] A GUI for beginners and experts alike

2018-08-24 Thread Greg Ewing
p is dead, but there is a heck of a lot going on in the browser. And if someone could write a simple GUI for a desktop app, and then easily prt that to a WebApp -- that would be great. Pyjamas seems to be something like that: https://pypi.org/project/Pyjamas/ -- Greg

Re: [Python-ideas] A GUI for beginners and experts alike

2018-08-24 Thread Greg Ewing
thout Gtk are currently out ofscope -- but contributions are always welcome! -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] A GUI for beginners and experts alike

2018-08-24 Thread Greg Ewing
([ [Label("A"), a], [Label("B"), b], [Label("A + B"), c], ], padding = (10, 10))) win.shrink_wrap() win.show() application().run() -- Greg ___ Python-ideas mailing list Python-ideas@pyt

Re: [Python-ideas] A GUI for beginners and experts alike

2018-08-24 Thread Greg Ewing
eople here willing to help you develop it. You may just need to be prepared to ignore some digressions. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] On evaluating features [was: Unpacking iterables for augmented assignment]

2018-08-28 Thread Greg Ewing
ing generalisation of multiple assignment targets might be. Would you write a += b += c += 1 or a = b = c += 1 ? And if the former, do we allow different operations on each target, e.g. a += b -= c *= 2 ? -- Greg ___ Python-ideas mailing list

Re: [Python-ideas] Pre-conditions and post-conditions

2018-08-28 Thread Greg Ewing
lf.y + self.height - 1) in self (self.x + self.width, self.y + self.height) not in self # body of __init__ goes here... -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-i

Re: [Python-ideas] Pre-conditions and post-conditions

2018-08-29 Thread Greg Ewing
ut static typing and contracts are *different things* in Eiffel. Static types are checked at compile time, contracts are checked at run time. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas C

Re: [Python-ideas] Fix some special cases in Fractions?

2018-08-29 Thread Greg Ewing
Also, Fraction(1) for the second case would be flat-out wrong. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Fix some special cases in Fractions?

2018-08-30 Thread Greg Ewing
actions do something different would make it inconsistent with floats. My calculator (which only does real floats) reports an error when trying to evaluate (-1) ** (2/3). -- Greg ___ Python-ideas mailing list [email protected] https://mail.pyth

Re: [Python-ideas] Fix some special cases in Fractions?

2018-08-30 Thread Greg Ewing
eturn float or complex results, which could then be discontinuous with the rational ones. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Fix some special cases in Fractions?

2018-08-30 Thread Greg Ewing
;t want to include those you'll have to explain your rationale. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Add recordlcass to collections module

2018-09-02 Thread Greg Ewing
s C: __slots__ = ('attr_1', ..., 'attr_m') def __new __ (cls, attr_1, ..., attr_m): self.attr_1 = attr_1 ... self.attt_m = attr_m -- Greg ___ Python-ideas mailing list [email protected] https://ma

Re: [Python-ideas] Pre-conditions and post-conditions

2018-09-03 Thread Greg Ewing
sh) # do something here for d in doshes: assert is_distimmed(d) This ticks the precondition and postcondition boxes, but still doesn't give you any idea what a Dosh is and why you would want to distim it. -- Greg ___ Py

Re: [Python-ideas] Executable space protection: NX bit,

2018-09-03 Thread Greg Ewing
Jonathan Fine wrote: # Evil code! ask_delete.__code__, ask_save.__code__ = ask_save.__code__, ask_delete.__code__ If an attacker can trick you into executing that line of code, he can probably just delete your data directly. -- Greg

Re: [Python-ideas] Keyword only argument on function call

2018-09-06 Thread Greg Ewing
x27;s natural to want a way to avoid repeating yourself so much when passing them on. So I think the underlying idea has merit, but the particular syntax proposed is not the best. -- Greg ___ Python-ideas mailing list [email protected] https://mail.pyth

Re: [Python-ideas] Fwd: Add Unicode-aware str.reverse() function?

2018-09-08 Thread Greg Ewing
natural language text (in which case all the tricky unicode stuff probably doesn't apply anyway). For such a rare requirement, maybe a module on PyPI would be a better solution than adding a string method. -- Greg ___ Python-ideas mailing list P

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Greg Ewing
m a Czech word meaning "forced worker". https://www.etymonline.com/word/robot -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Greg Ewing
tirely possible for a thing to be spotlessly clean without being beautiful or elegant. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Greg Ewing
ot; and "ugly" to be expunged from the language is saying that we shouldn't be allowed to choose *anything* based on how it affects us aesthetically. That, I think, would make the world a rather miserable place to live in. -- Greg ___ Pyt

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-14 Thread Greg Ewing
reflect that we care a *lot* about aesthetics in Python. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-14 Thread Greg Ewing
actress Samantha Quan is a russian spy... -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-15 Thread Greg Ewing
Chris Barker via Python-ideas wrote: "efficient is better than inefficient" kind of goes without saying... Perhaps we should just replace the entire Zen with "Good is better than bad." Insert your own subjective ideas on what constitutes "good" and "bad&

Re: [Python-ideas] Moving to another forum system where moderation is possible

2018-09-20 Thread Greg Ewing
hich makes it more personal and meaningful than a "+1" counter getting incremented somewhere. Counting only makes sense if the counts are going to be treated as votes, and we don't do that. -- Greg ___ Python-ideas mailing list Pyth

  1   2   3   4   5   6   7   8   9   >