Re: [Python-ideas] In fact, I'm a bit worry about this literal p""

2018-12-31 Thread Yuval Greenfield
On Fri, Dec 28, 2018 at 1:56 AM Ma Lin wrote: > Maybe this literal will encourage people to finish tasks using regex, > even lead to abuse regex, will this change Python's style? > > What's worse is, people using mixed manners in the same project: > > one_line.split(',') > ... > p','.split(one_li

Re: [Python-ideas] Relative Imports

2018-11-13 Thread Yuval Greenfield
on is always obvious because it works just like it works in every system - with a file-relative path. File-relative imports is probably highest on my Python wish list. I've drafted but not sent out a python-ideas email about it multiple times. I've seen a lot of "sys.path" hac

Re: [Python-ideas] Trigonometry in degrees

2018-06-07 Thread Yuval Greenfield
On Thu, Jun 7, 2018 at 10:38 PM Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > > 6.123233995736766e-17 > >>> > > is good enough for government work, including at the local public high > school. > > There probably is room for a library like "fractions" that represents multiples

Re: [Python-ideas] Trigonometry in degrees

2018-06-07 Thread Yuval Greenfield
On Thu, Jun 7, 2018 at 1:07 PM Robert Vanden Eynde < robertvandeney...@hotmail.com> wrote: > I suggest adding degrees version of the trigonometric functions in the > math module. > > You can create a pypi package that suits your needs. If it becomes popular it could considered for inclusion in the

Re: [Python-ideas] Add dict.append and dict.extend

2018-06-04 Thread Yuval Greenfield
On Mon, Jun 4, 2018 at 3:58 PM George Leslie-Waksman wrote: > Semantically, I'm not sure append and extend would be universally > understood to mean don't overwrite. > > The proposed meanings surprised me too. My initial instinct for `dict.append` was that it would always succeed, much like `list

Re: [Python-ideas] Please consider skipping hidden directories in os.walk, os.fwalk, etc.

2018-05-08 Thread Yuval Greenfield
On Mon, May 7, 2018 at 9:44 PM Steve Barnes wrote: > Since the implementation of os.walk has changed to use os.scandir which > exposes the returned file statuses in the os.DirEntry.stat() the > overhead should be minimal. > > An alternative would be to add another new function, say os.vwalk(), to

[Python-ideas] __dir__ in which folder is this py file

2018-05-05 Thread Yuval Greenfield
of my python scripts. * This is such a common construct that everyone giving it their own name seems suboptimal for communicating. Common names include: here, path, dirname, module_dir. Cheers, Yuval Greenfield P.s. nodejs has it - https://nodejs.org/docs/latest/api/modules.html#modules_dirname al