Re: [Python-ideas] A decorator to call super()

2017-01-31 Thread Ryan Gonzalez
https://github.com/kirbyfan64/mirasu \-- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else ___ Python-ideas mailing list Python-ideas@python.org

Re: [Python-ideas] pathlib suggestions

2017-01-24 Thread Ryan Gonzalez
As another suggestion, I'd love an rmtree method analogous to shutil.rmtree. And maybe also a remove method, that basically does: if path.is_dir(): path.rmtree() else: path.unlink() \-- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >>

[Python-ideas] List indexing multiple elements

2017-02-20 Thread Ryan Gonzalez
Apologies if this has already been covered! Right now, if you want to get multiple elements in a list, you have to do: elements = [mylist[a], mylist[b]] My proposal is two-folded: - Right now, a[b,c] is already valid syntax, since it's just indexing a with the tuple (b, c). The proposal is to

Re: [Python-ideas] Extending expressions using ellipsis

2016-08-31 Thread Ryan Gonzalez
On Aug 31, 2016 7:22 PM, "Chris Kaynor" wrote: > > Guido's time machine strikes again, GAH! We should've just used that for PEPs 484 and 526; instead of trying to prove type hints are useful, Guido could've just: 1. Go 50 years into the future. 2. Make note of the

Re: [Python-ideas] Typecheckers: there can be only one

2016-09-07 Thread Ryan Gonzalez
On Sep 7, 2016 4:28 AM, "Hugh Fisher" wrote: > > There's been discussion here and on python-dev regarding PEP 526 that > assumes there will be multiple type checkers for Python. I really > can't see this happening. It already did: - mypy - pytype - PyCharm has an

Re: [Python-ideas] Null coalescing operator

2016-09-10 Thread Ryan Gonzalez
https://github.com/kirbyfan64/_frozensafemockobjectimplementation In all seriousness, though, I really feel like that would be the ultimate bug magnet, since it'd be easy to forget to un-wrap the object afterwards. -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your

Re: [Python-ideas] from __pip__ import

2016-09-19 Thread Ryan Gonzalez
This sounds like a great idea, but I've seen stuff like this done before, and it never ends well. You end up with a gargantuan-sized rabbit hole, since running a basic script could now involve using an internet connection and potentially root permissions. IF one were to go this route, I prefer

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Ryan Gonzalez
So, based on everyone's feedback, I just created this: http://bugs.python.org/issue28536 On Mon, Oct 24, 2016 at 5:07 PM, Ryan Gonzalez <rym...@gmail.com> wrote: > I personally find it kind of annoying when you have code like this: > > > x = A(1, B(2, 3)) > > > and P

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Ryan Gonzalez
Also, as an extension of this idea, would it be possible to improve errors like this: class X: pass X() # object() takes no parameters to show the actual type instead of just 'object'? On Tue, Oct 25, 2016 at 4:48 PM, Ryan Gonzalez <rym...@gmail.com> wrote: > So, based on everyone's

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Ryan Gonzalez
Yeah, I just checked the source and tried changing it. Seems to work well. On Tue, Oct 25, 2016 at 8:11 PM, Steven D'Aprano <st...@pearwood.info> wrote: > On Tue, Oct 25, 2016 at 04:55:21PM -0500, Ryan Gonzalez wrote: > > Also, as an extension of this idea, would it be poss

Re: [Python-ideas] PEP 531: Existence checking operators

2016-10-29 Thread Ryan Gonzalez
On Oct 28, 2016 3:30 AM, "Nick Coghlan" wrote: > *snip* > > 1. Do we collectively agree that "existence checking" is a useful > general concept that exists in software development and is distinct > from the concept of "truth checking"? I'd hope so! > 2. Do we collectively

Re: [Python-ideas] Add a method to get the subset of a dictionnary.

2016-10-12 Thread Ryan Gonzalez
That discussion seemed to mostly just conclude that dicts shouldn't have all set operations, and then it kind of just dropped off. No one really argued the subset part. -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong.

[Python-ideas] Showing qualified names when a function call fails

2016-10-24 Thread Ryan Gonzalez
I personally find it kind of annoying when you have code like this: x = A(1, B(2, 3)) and Python's error message looks like this: TypeError: __init__() takes 1 positional argument but 2 were given It doesn't give much of a clue to which `__init__` is being called. At all. The idea: when

Re: [Python-ideas] PEP8 dictionary indenting addition

2016-10-11 Thread Ryan Gonzalez
On Oct 11, 2016 10:40 AM, "Erik Bray" wrote: > > On Sun, Oct 9, 2016 at 2:25 AM, Steven D'Aprano wrote: > > On Sat, Oct 08, 2016 at 09:26:13PM +0200, Jelte Fennema wrote: > >> I have an idea to improve indenting guidelines for dictionaries for better >

Re: [Python-ideas] Proposal for default character representation

2016-10-12 Thread Ryan Gonzalez
On Oct 12, 2016 4:33 PM, "Mikhail V" wrote: > > Hello all, > > *snip* > > PROPOSAL: > 1. Remove all hex notation from printing functions, typing, > documention. > So for printing functions leave the hex as an "option", > for example for those who feel the need for hex

Re: [Python-ideas] Proposal for default character representation

2016-10-12 Thread Ryan Gonzalez
On Oct 12, 2016 9:25 PM, "Chris Angelico" wrote: > > On Thu, Oct 13, 2016 at 12:56 PM, Mikhail V wrote: > > But as said I find this Unicode only some temporary happening, > > it will go to history in some future and be > > used only to study extinct

Re: [Python-ideas] Python Reviewed

2017-01-10 Thread Ryan Gonzalez
I just want to point ONE thing out: On Jan 9, 2017 11:18 PM, "Simon Lovell" wrote: * General comment: I posted this because Googling didn't give me a satisfactory answer to why Python is the way that it is. I think I see it now. Guido hates keywords. I don't find this

Re: [Python-ideas] incremental hashing in __hash__

2016-12-27 Thread Ryan Gonzalez
You could always try to make a Python version of the C tuple hashing function[1] (requires the total # of elements) or PyPy's[2] (seems like it would allow true incremental hashing). API idea: hasher = IncrementalHasher() hasher.add(one_item_to_hash) # updates hasher.hash property with result #

Re: [Python-ideas] Adding an 'errors' argument to print

2017-03-26 Thread Ryan Gonzalez
FWIW, using the ascii function does have the problem that Unicose characters will be escaped, even if the terminal could have handled them perfectly fine. -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else http://refi64.com On Mar 26, 2017 9:07 AM, "Nick

Re: [Python-ideas] IDEA

2017-03-26 Thread Ryan Gonzalez
There are quite a few Python IDEs, like PyCharm, Ninja, Spyder, PyDev, and more. In addition, I would say that almost every currently existent text editor has at least *some* Python support (I personally use Howl, though I'll admit I'm rather biased, being part of the development team and all...

Re: [Python-ideas] What about regexp string litterals : re".*" ?

2017-03-29 Thread Ryan Gonzalez
I feel like that borders on a bit too wordy... Personally, I'd like to see something like Felix's regular definitions: http://felix-lang.org/share/src/web/tut/regexp_01.fdoc#Regular_definitions._h -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else

[Python-ideas] Adding an 'errors' argument to print

2017-03-24 Thread Ryan Gonzalez
Recently, I was working on a Windows GUI application that ends up running ffmpeg, and I wanted to see the command that was being run. However, the file name had a Unicode character in it (it's a Sawano song), and when I tried to print it to the console, it crashed during the encode/decode. (The

Re: [Python-ideas] What about regexp string litterals : re".*" ?

2017-04-03 Thread Ryan Gonzalez
Have you tried PyParsing and/or Grako? They're some of my favorites (well, I like PLY too, but I'm thinking you wouldn't like it too much). -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else http://refi64.com On Apr 3, 2017 3:26 AM, "Neil Girdhar"

Re: [Python-ideas] "import me" to display some summary of the current python installation

2017-04-11 Thread Ryan Gonzalez
...except it would break everybody who has a module named `me` (which admittedly isn't too common...). Something like `import this.what` or something like that would be cool, though. -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else http://refi64.com On

Re: [Python-ideas] Wrapper for ctypes

2017-03-07 Thread Ryan Gonzalez
Ever looked up cffi? You won't be disappointed. -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else http://refi64.com On Mar 7, 2017 3:43 AM, "George Fischhof" wrote: > Hi Guys, > > right now I had to call functions from a dll, and I

Re: [Python-ideas] Augmented assignment syntax for objects.

2017-04-25 Thread Ryan Gonzalez
FWIW I always liked Dart's/Ruby's/Crystal's/(Coffee|Moon)Script's/WhateverElse's style: class Cls { Cls(this.a); // IT'S MAGIC } but the Python equivalent is admittedly weirder: def ___init__(self, self.attr): partly because, it'd have to work on pretty much any other variable name, yet

Re: [Python-ideas] Augmented assignment syntax for objects.

2017-04-27 Thread Ryan Gonzalez
*cough* I'll just drop this here a sec *cough*: https://code.activestate.com/recipes/580790-auto-assign-self-attributes-in-__init__-using-pep-/ On Thu, Apr 27, 2017 at 10:24 AM, Nick Coghlan wrote: > On 25 April 2017 at 11:08, Erik wrote: >> Hi. I

Re: [Python-ideas] Tighten up the formal grammar and parsing a bit?

2017-05-15 Thread Ryan Gonzalez
I guess maybe if you overload the operators to return broken objects, maybe then they would be different? -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else http://refi64.com On May 15, 2017 9:50 AM, "Serhiy Storchaka" wrote: > On

Re: [Python-ideas] dict(default=int)

2017-05-29 Thread Ryan Gonzalez
Sometimes I feel that it would be neat of dict constructors (like proposed previously in the thread) could also be chained, e.g.: dict.ordered.default(int)(a=1, b=2) -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else http://refi64.com On May 29, 2017 2:06

Re: [Python-ideas] π = math.pi

2017-06-01 Thread Ryan Gonzalez
I'm slightly confused as to what you mean, but here goes: So you're saying that: - Glyphs like pi have an ambiguous width. - Most text editors/terminals let you choose between halfwidth (roughly normal monospace width?) and fullwidth (double the size). - However, many East Asian fonts do NOT

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread Ryan Gonzalez
One thing I want to point out: there are a lot of really useful Python libraries that have come to rely on annotations being objects, ranging from plac to fbuild to many others. I could understand something that delays the evaluation of annotations until they are accessed, but this seems really

[Python-ideas] Adding "View Python 3 Documentation" to all Python 2 documentation URLs

2017-09-06 Thread Ryan Gonzalez
Right now, many Google searches for Python modules return the Python 2 documentation. IMO since 2 will be reaching EOL in around 3 years, it would be nice to have a giant red box at the top with a link to the Python 3 documentation. SFML already does something like this:

Re: [Python-ideas] A proliferation of (un-)Pythonically programmatic pragmas

2017-11-13 Thread Ryan Gonzalez
Off the top of my head there's: - Offer a standard pragma-parser in the standard library's ast module that allows multiple pragmas per line. This is kind of the reason there's the weird ast vs typed_ast discrepancy right now, too. - Create a custom pragma syntax that doesn't use comments. Maybe

Re: [Python-ideas] Dart like multi line strings identation

2018-03-31 Thread Ryan Gonzalez
I have to admit, regardless of how practical this is, it would surely get rid of a ton of textwrap.dedent calls all over the place... On March 31, 2018 9:50:43 AM Marius Räsener wrote: Hey List, this is my very first approach to suggest a Python improvement I'd think

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-18 Thread Ryan Gonzalez
On Sun, Mar 18, 2018 at 4:16 PM, George Fischhof wrote: > Hi Jason, > > the status of os and shutil became this because of C functions in > implementation (I got something similar answer before) > ... > > What do you think, what would be a good way to solve this > - add stuff

Re: [Python-ideas] A "local" pseudo-function

2018-04-28 Thread Ryan Gonzalez
I'm pretty sure the debate about braces defining scope in Python has long-since ended... -- Ryan (ライアン) Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else https://refi64.com/ On April 28, 2018 9:37:57 PM Ken Hilton wrote: > local { m =

Re: [Python-ideas] A comprehension scope issue in PEP 572

2018-05-06 Thread Ryan Gonzalez
On May 6, 2018 8:41:26 PM Tim Peters wrote: In a different thread I noted that I sometimes want to write code like this: while any(n % p == 0 for p in small_primes): # divide p out - but what's p? But generator expressions hide the value of `p` that

Re: [Python-ideas] A "local" pseudo-function

2018-04-28 Thread Ryan Gonzalez
I have to say, this idea feels really nice to me. It's far easier to read than := and separates the assignments and the result expression nicely. Others have brought up the same problem of = vs ==. IMO a solution could be to make a requirement that the last argument is NOT an assignment. In

Re: [Python-ideas] Inline assignments using "given" clauses

2018-05-11 Thread Ryan Gonzalez
On May 11, 2018 1:45:27 PM Tim Peters wrote: [Brendan Barnwell] . . . and it's true the latter is a bit more verbose in that case for little extra benefit. But when the locally-defined value is used within a more complicated expression (like the quadratic formula

Re: [Python-ideas] Inline assignments using "given" clauses

2018-05-10 Thread Ryan Gonzalez
Probably going to completely lose this, but would it be possible to have a vote? +1 for either 'given' and/or ':='? On Thu, May 10, 2018 at 2:48 PM Guido van Rossum wrote: > Yes. > > On Thu, May 10, 2018, 13:18 Alexander Belopolsky < > alexander.belopol...@gmail.com> wrote: >