[Python-ideas] built in to clear terminal

2020-12-19 Thread Christopher Barker
return None Which makes me think -- yes, it would be nice to have that available in the standard lib somewhere. -CHB -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cytho

[Python-ideas] Re: built in to clear terminal

2020-12-20 Thread Christopher Barker
#x27;clear') elif sys.platform == 'win32': def _term_clear(): os.system('cls') else: def _term_clear(): pass (https://github.com/ipython/ipython/blob/master/IPython/utils/terminal.py) is it so bad to use a subprocess? -CHB -- Christopher Barker, Ph

[Python-ideas] Re: built in to clear terminal

2020-12-20 Thread Christopher Barker
On Sun, Dec 20, 2020 at 1:23 PM Cameron Simpson wrote: > On 20Dec2020 08:51, Christopher Barker wrote: > >On Sat, Dec 19, 2020 at 8:53 PM Guido van Rossum > wrote: > >> at sounds like a very special status. Why not os.clear()? > > My anger at programmes which gratu

[Python-ideas] Re: Standalone bool?

2020-12-21 Thread Christopher Barker
/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas

[Python-ideas] Re: built in to clear terminal

2020-12-21 Thread Christopher Barker
required in Windows. so that could be plugged in to the above, with (or not) a fallback to the system calls. Anyway, this has been interesting enough to distract me from other things I should be doing, but I'm moving on now ... -CHB -- Christopher Barker, PhD Python Language Consul

[Python-ideas] Re: Possibility to decorate single code line or code block?

2020-12-21 Thread Christopher Barker
; ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/a

[Python-ideas] Re: Possibility to decorate single code line or code block?

2020-12-21 Thread Christopher Barker
11/05/hard-writing/ > > I'm also reminded of Einstein's (or is it?) Everything Should Be Made as > Simple as Possible, But Not Simpler. > https://quoteinvestigator.com/2011/05/13/einstein-simple/ > > -- > Jonathan > -- Christopher Barker, PhD Python Language Co

[Python-ideas] Re: Standalone bool?

2020-12-21 Thread Christopher Barker
returned by Python itself? But anyway, it would certainly be even more disruptive now. - CHB -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython _

[Python-ideas] Re: built in to clear terminal

2020-12-22 Thread Christopher Barker
at in the last 2 minutes. > interesting .. any idea what conda package is providing it? -CHB -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython _

[Python-ideas] Re: Capture manylinux environment set-up in pyproject.toml

2020-12-23 Thread Christopher Barker
on build dependencies to avoid scope creep > > 4. `python_runtime_dependencies`: I believe this information is already > captured in PEP-631: Dependency specification in pyproject.toml based on > PEP 508 (https://www.python.org/dev/peps/pep-0631/) > >

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

2020-12-26 Thread Christopher Barker
__ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/2HM

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

2020-12-26 Thread Christopher Barker
On Sat, Dec 26, 2020 at 4:35 PM Greg Ewing wrote: > On 27/12/20 10:15 am, Christopher Barker wrote: > > ... the only thing > > you should *need* is an items() method that returns an iterable (pf > > pairs of objects). > > It seems to me it would be more fundamental to

[Python-ideas] Re: built in to clear terminal

2020-12-26 Thread Christopher Barker
; Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/FU7MZE

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

2020-12-28 Thread Christopher Barker
t; obj = MyMap(2, 3) > >>> len(obj) > TypeError: object of type 'MyMap' has no len() > >>> obj.keys() > AttributeError: 'MyMap' object has no attribute 'keys' > >>> obj['x'] > TypeError: 'MyMap' object is n

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

2020-12-28 Thread Christopher Barker
On Mon, Dec 28, 2020 at 12:33 PM Guido van Rossum wrote: > On Mon, Dec 28, 2020 at 12:15 PM Christopher Barker > wrote: > >> Though frankly, I would rather have had it use .items() -- seems more >> efficient to me, and you do need both the keys and the values, and items

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

2020-12-29 Thread Christopher Barker
"is* a Mapping. I see this as a fundamental clash between the concept of an "ABC" and duck typing -- an ABC defines everything that *could* be needed, whereas duck typing requires only what is actually needed in a given context. But if that's the case, it should be documented. -CHB

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

2020-12-29 Thread Christopher Barker
well. I also just noticed something else in the docs -- in typing, there is a Protocol type -- maybe we could/should pre-define a mapping protocol type? Or maybe a MinimialMapping ABC, analogous to the Iterable ABC -- though no idea what to call it that would be clear :-) -

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

2020-12-29 Thread Christopher Barker
needed as the language evolves. > I don't "have" to do anything, nor does anyone else contributing to the development or documentation of Python. But tone aside, I think you're pushing pretty hard for something that doesn't really fit Python -- again, Duc

[Python-ideas] Re: On the history and usage of vars [was Re: Re: Unpack operator "**" and Mapping]

2020-12-30 Thread Christopher Barker
ing with .__dict__ you are doing meta-programming, for which poking around in the dunders makes perfect sense. -CHB -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython __

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

2020-12-30 Thread Christopher Barker
ot do anything else with it. 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 "protocols"!) > I think the ABCs Are definitive -- but what are they

[Python-ideas] Re: Right way to dataclass -> dict conversion.

2020-12-30 Thread Christopher Barker
id, an option to do a "shallow" or "deep" conversion in asdict() makes sense to me. -CHB -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython __

[Python-ideas] Re: Right way to dataclass -> dict conversion.

2020-12-31 Thread Christopher Barker
lace :-) Eric: what do you think about adding a "shallow" (or "deep") flag to dataclasses.asdict() that would then upack only the top-level dataclass? -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development

[Python-ideas] Re: Right way to dataclass -> dict conversion.

2021-01-01 Thread Christopher Barker
s json, but I'm not sure how well it fills that need. > If you ask me, not very well, and there would have been no need to copy lists and the like for that purpose anyway. JSON-compatible Python is a specific thing -- you are either targeting that or not :-) > As I said, I don't th

[Python-ideas] Re: Add venv activate command to the venv modules

2021-01-04 Thread Christopher Barker
HRB 46611 >https://www.egenix.com/company/contact/ > https://www.malemburg.com/ > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.o

[Python-ideas] Re: Python JIT Compilation Thoughts

2021-01-05 Thread Christopher Barker
n.org/message/B6UM6566HMUP4O3WKXCP3GMT4RDPHCJJ/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython _

[Python-ideas] Re: Additional LRU cache introspection facilities

2021-01-12 Thread Christopher Barker
care about performance (within reason). My use > case is interactive debugging. > > > -- > Steve > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > htt

[Python-ideas] Re: [Python-Dev] reversed enumerate

2021-01-21 Thread Christopher Barker
d. I agree. >> If you made enumerate return a sequence when its input is a sequence, you would also be able to do enumerate(some_list)[34], As Chris A mentioned, it's quite easy to wrap list() or tuple() around it if you want that. - Chris B -- Christopher Barker, PhD (Chris) Pyt

[Python-ideas] Re: Changing the default text encoding of pathlib

2021-01-25 Thread Christopher Barker
den bug that might reveal itself in the hands of end users who knows when in the future. Whereas (B) will be a bug that is likely to reveal itself fairly quickly (though perhaps also in the (confused) hands of end users as well) -Chris B -- Christophe

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-01-28 Thread Christopher Barker
o unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/LQVK2UKPSOI2AHYFUWK6ZII2U6QKK6BP/ > Code of Conduct: http://python

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-01-29 Thread Christopher Barker
#x27;s easy to recommend users to > enable UTF-8 mode. > Back to my idea above -- any way to have that be a pip (and conda) installable package? So it could be in a requirements file? Do you mean programs only runs on UTF-8 mode warns if UTF-8 mode is > not enabled? e.g. > > ``` >

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-01-30 Thread Christopher Barker
t guaranteed that all other supported systems other than Windows use utf-8? or should UTF8-mode be available everywhere, even though in most cases it won't make a difference. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Te

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-02 Thread Christopher Barker
ns. And that's been addressed with with "environments" of various sorts. So it would be good to leverage that, and have a config file that goes right along with the environment systems: i.e. it's part of that particular Python install, And ideally, it could be installed with p

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-02 Thread Christopher Barker
uot;applications". packages have their dependencies declared internally (in setup.py, or pypackage.toml) -- applications have an external requirements file. So the assume-utf8 package should only be used in a requirements file, not a package's dependencies. And I think that's a hel

[Python-ideas] Re: Add a couple of options to open()'s mode parameter to deal with common text encodings

2021-02-04 Thread Christopher Barker
nce they omit > encoding='utf-8' all the time. > true, but I think many, if not most, folks do not know that they are making that choice, but rather, not thinking about it, and when it works most of the time, then they're done (I'm sure guilty of that!). Anyway, I think othe

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-04 Thread Christopher Barker
nk the site-packages path hasn't been configured yet when this is needed, so that's a trick. So if this config file could be somewhere pip could install it I think that would be helpful. Personally, I'm a conda user, and conda can install files anywhere in the tree -- so I would l

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-04 Thread Christopher Barker
"UTF8-MODE" (it could be empty) next to python.exe? That would presumably be faster than having to actually open and read a file, and would be easy to install. - CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-05 Thread Christopher Barker
By the way, if we go with pyvenv.cfg then an option should be added to the venv command as well. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxP

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-06 Thread Christopher Barker
nda (and maybe other) environments well. -Chris B -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas mailing list -- py

[Python-ideas] Re: Conditional with statements

2021-02-07 Thread Christopher Barker
u, but you COULD simply use 2 spaces for a if:with combo. -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas mailing list

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-07 Thread Christopher Barker
re using or they can't. > Config file in user profile is fragile. If all venvs start using > profile directory, it become unmaintainable soon. > exactly -- if this is added, I will certianly not recommend anyone use it. > We can just recommend per-user install for new use

[Python-ideas] Re: Conditional with statements

2021-02-07 Thread Christopher Barker
on.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/2KGKLH54CIKZ2EB6ZDPIXJ745FZKW45C/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consult

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-08 Thread Christopher Barker
I) environments might need it too. Which is another good reason that having it be something that can be "turned on" by an virtual environment / requirements file would be very helpful. -Chris B. -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-08 Thread Christopher Barker
xtra step you need folks to do by hand. Ideally a package that could be put in a requirements file. That is, I could simply put "utf8_mode" in my requirements file(s) and anyone that installed those requirements into an environment would get it configured. 3) One way to do that that's

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-08 Thread Christopher Barker
I have no time to discuss about helping > zero Unix users. > By all means -- spend your time on what you think is important. You asked for others' opinions, I've given mine. If you don't agree, so be it. Thanks for your work on this -- anything you do will be an improvement.

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-09 Thread Christopher Barker
other nice bit is that eventually, if/when utf-8 becomes the default in a future python, this becomes a no-op and my users don't have to know anything has changed. In a way, what I'm looking for is a system-wide equivalent to a __future__import -- maybe impossible, but it'd be ni

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-09 Thread Christopher Barker
e conflict than installing a package of a particular version? But this might be a case for using the pyenv.cfg file -- that IS intended to be manipulated by the environment tool. Though yes, having it looked for outside of the dir where python lives is not good. Have you arrived at a concrete proposal

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-09 Thread Christopher Barker
It's not -- using PYTHONPATH is a "bad idea" I never recommend it to anyone. It was a nightmare when folks have Python 2 and 3 on the same machine, but now, in the age of environments, it's still a really bad idea. It's really important to support configuration per environm

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-10 Thread Christopher Barker
the training environment one way or another anyway? > That's why I'd like "one way to do it" on all platforms -- see other parts of this thread. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Softwar

[Python-ideas] Re: Alternate lambda syntax

2021-02-13 Thread Christopher Barker
___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/pytho

[Python-ideas] Re: Conditional with statements

2021-02-13 Thread Christopher Barker
Random | area.IsTour): self.ToggleDynamic(event, 1) elif ch == "Z" and CanZapImage: self.Zap(event) elif ch == "A" and not (area.Dynamic | area.IsTour): self.ToggleRandom(event, 1) # Alt-R doesn't always work for some reason, so we give Alt-A as an alternative else

[Python-ideas] Re: Alternate lambda syntax

2021-02-14 Thread Christopher Barker
e already written -- any changes to syntax should only be ones that add real functionality or expressiveness -- a slightly-easier-to-write (and maybe read) anonymous function syntax is nowhere near that threshold. -Chris B -- Christopher Barker, PhD (Chris) Python Language Consulting - Teachin

[Python-ideas] Re: Conditional with statements

2021-02-14 Thread Christopher Barker
. > My original was a clear, tabular layout making the code structure > completely clear, the vertical alignment *highlighting where different > cases are treated differently and where they are treated similarly*. > This is just an amorphous mass of code that I find much harder t

[Python-ideas] Re: Conditional with statements

2021-02-15 Thread Christopher Barker
.) > I'm not sure I'd call it "tricks" -- but anyway, I've found that big nested ifelses are rarely the cleanest solution -- but not never. - Chris B. -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Deskto

[Python-ideas] Re: Adding PathLiteral class and existing object instance to pathlib

2021-02-15 Thread Christopher Barker
oo") I guess I don't find the proposal or variation worth it to me -- though I guess it's easier when you are translating code that uses string paths already -- but not much easier. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific

[Python-ideas] Re: SimpleNamespace vs object

2021-02-17 Thread Christopher Barker
a __dict__. But given that all classes derive from object, and object is of type type, and classes are of type type -- I still have no idea why we can't add things to an instance of object. I suppose adding stuff to the object class itself would be very weird -- as that would mess with ALL clas

[Python-ideas] Re: Syntax for duplicate types in seq[...]

2021-02-20 Thread Christopher Barker
On Fri, Feb 19, 2021 at 9:17 PM Dennis Sweeney wrote: > Does this work? > > >>> tuple[(int,) * 7 + (str,)] > tuple[int, int, int, int, int, int, int, str] Even better: TImeTuple = tuple[(int,) * 7 + (str,)] and then: def time() ->TimeTuple ... -CHB

[Python-ideas] Re: [Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Christopher Barker
o and all that? Well, I used it in the old days because > that's what the instructions said. But, to be honest, it never made any > sense. I agree — keep it all on user land. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Develop

[Python-ideas] Re: Make list.reverse() more flexible

2021-03-07 Thread Christopher Barker
t; https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/4PDBVLJPWU2B4XIGIC7IY4PYMSTTYXOP/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris)

[Python-ideas] Re: Make list.reverse() more flexible

2021-03-08 Thread Christopher Barker
ite to code and/or significantly improve performance. “Exhibiting intelligence and power” is not enough. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, nu

[Python-ideas] Re: Add an export keyword to better manage __all__

2021-03-13 Thread Christopher Barker
module import sys would not work? That might be odd and confusing. -CHB Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython

[Python-ideas] Re: Reverse polish notation

2021-04-02 Thread Christopher Barker
r with infix, hardly anyone is familiar with RPN. -CHB Less useful on smaller equations, where algebraic is probably more > appropriate just because people are used to algebraic: > No small advantage. Frankly, putting long equations all in one line of code will always be hard to read. --

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

2021-04-08 Thread Christopher Barker
for with to work with files, even without a try block around it. :-( -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, sc

[Python-ideas] Re: Adding syntax for the empty set

2021-04-09 Thread Christopher Barker
dict fit in? maybe: {:,} ? kinda ugluy, but provides more symmetry The fact that () creates a tuple, but (2) does not is problematic -- way too late to change anything there, but adding (,) as an optional empty tuple might help a tiny bit in the future. -CHB -- Christopher Barker, PhD (Chris) Python L

[Python-ideas] Revive: PEP 396 -- Module Version Numbers ?

2021-04-12 Thread Christopher Barker
me. I note that PEP8 uses __version__ as an example of a "module level dunder" -- but only suggests where it should be put, not how it be used :-) Of course, there will be a need to update the PEP to match current practice (and setuptools and pip) Or should this be brought up on

[Python-ideas] Re: Revive: PEP 396 -- Module Version Numbers ?

2021-04-13 Thread Christopher Barker
ut let's not have it be provisional then! And the fact is, that PEP's been provisional for 13 years, and __version__ is widely, but certainly not universally, adopted. We really should get a pronouncement on this one way or another. Thanks, -CHB > On Mon, 12 Apr 2021, 19:51 C

[Python-ideas] Re: Revive: PEP 396 -- Module Version Numbers ?

2021-04-13 Thread Christopher Barker
territory. indeed, and that's actually the point here. However, I suspect that the core devs will strongly rely on PyPA's thoughts on the matter. > I suspect the best thing to do would be to check with the SC on their > view, and if they want to toss it in my direction, I'

[Python-ideas] Re: Revive: PEP 396 -- Module Version Numbers ?

2021-04-13 Thread Christopher Barker
On Tue, Apr 13, 2021 at 1:29 PM Serhiy Storchaka wrote: > 12.04.21 21:49, Christopher Barker пише: > > If I have a time I finish my large patch for getting rid of __version__ > and other outdated variables. It was approved previously > ( > https://mail.python.org/ar

[Python-ideas] Re: Iterable scalar values returning itself ones?

2021-04-14 Thread Christopher Barker
gt; Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message

[Python-ideas] Re: String comprehension

2021-05-01 Thread Christopher Barker
ight write, and I suspect most of those are already covered by string methods. [actually, I think this is a similar point as that made by David Mertz) -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web D

[Python-ideas] Re: String comprehension

2021-05-03 Thread Christopher Barker
r favour. (Although I'm not as enamoured > with f-strings as many folks.) > I am :-) But while f-strings do put executable code inside a string, they are more conceptually similar to regular string literals -- right down to having a raw version :-) However, if one wants to go w

[Python-ideas] Re: Comprehensions within f-strings

2021-05-03 Thread Christopher Barker
an TypeError. I understand the lesson that is supposed to be provided by making that an error, but I'm not sure it really helps anyone really learn anything. would that be more "intuitive" than "".join() maybe -- the fact that the Error was explicitly added implies that people w

[Python-ideas] Re: Changing The Theme of Python Docs Site

2021-05-08 Thread Christopher Barker
t know whether styling and corporate identity is part of the > scope, They just announced a new theme — so yes. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPyt

[Python-ideas] Re: division of integers should result in fractions not floats

2021-05-17 Thread Christopher Barker
de of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Py

[Python-ideas] Re: division of integers should result in fractions not floats

2021-05-20 Thread Christopher Barker
On Tue, May 18, 2021 at 6:28 AM Oscar Benjamin wrote: > > > and more difficult error analysis. > > > > I don't understand what you mean by "error analysis", unless you're > > referring to performance degradation due to Fraction propagation. > > The error analysis for arithmetic with Fraction is

[Python-ideas] Re: Introduce constants in Python (constant name binding)

2021-05-25 Thread Christopher Barker
if you want it for debugging, then static type checkers can do that for you. 2) This would allow another branch of OOP programming to enter Python. > Read-only member variables. There are Private members in Java and C++. Then use Java or C++ -- the benefits of Python are not primarily the syntax

[Python-ideas] Re: Introduce constants in Python (constant name binding)

2021-05-27 Thread Christopher Barker
s not a good fit > for Python. > > However: > > When you spoke of “like a literal” that brought to mind something else: a > C preprocccesor like pre-complier time substitution. Which might have some > use, but it would only work within a single module, so not very useful. >

[Python-ideas] Re: Add static variable storage in functions

2021-05-27 Thread Christopher Barker
threaded code later on. Personally, I can't think of any times when I would have used this -- maybe because it wasn't there, so I didn't think about it. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Deskt

[Python-ideas] Re: Add static variable storage in functions

2021-05-27 Thread Christopher Barker
to the language for this minor use case. > > -- > Brendan Barnwell > "Do not follow where the path may lead. Go, instead, where there is no > path, and leave a trail." > --author unknown > ___ > Python-ideas mailing li

[Python-ideas] Re: Add static variable storage in functions

2021-05-27 Thread Christopher Barker
> > My concern about thread safety is about how easy it would be to make it > > thread unsafe accidentally. > > I'm intrigued what gives you the impression that Python functions and > classes are, by default, thread safe. Well, there is thread safe, and there is thread dangerous. I have an enormo

[Python-ideas] Re: Add static variable storage in functions

2021-05-27 Thread Christopher Barker
g. len() in hundreds of separate places in one function -- you've got a much larger problem. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___

[Python-ideas] Re: The name Ellipsis should be a constant

2021-06-01 Thread Christopher Barker
y! > > -- > Steve > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://

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

2021-06-10 Thread Christopher Barker
It's not impossible to understand, but at least > for me I have to think "is this the syntax or is this an object?" > every time I see it. > > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an em

[Python-ideas] Re: Deprecate sum of lists

2021-06-16 Thread Christopher Barker
org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/FSD5TENDE4RLESDRPWN7WJ3WJMFPRASC/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consu

[Python-ideas] Re: Deprecate sum of lists

2021-06-16 Thread Christopher Barker
the OP linked, that was a suggested patch to optimize sum(list_of_lists) -- I'm not sure that's such a bad idea after all. -CHB NOTE: One reason I've never had to flatten a list of lists is because I'm a heavy numpy user -- I'd be more likely to have an ndarray and fla

[Python-ideas] Re: Deprecate sum of lists

2021-06-17 Thread Christopher Barker
types. The question is whether that's a good idea. The fact that it was decided to raise for strings, when an optimization could have been added answers that question. Despite my personal opinion, I think the only options are to raise for more types, with a helpful message, or just leave it al

[Python-ideas] Re: Deprecate sum of lists

2021-06-20 Thread Christopher Barker
___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.pytho

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

2021-06-21 Thread Christopher Barker
org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/YFGGY4TDNHHEGJ2T5UED67W44SXRKNHA/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (

[Python-ideas] Re: Extension methods in Python

2021-06-24 Thread Christopher Barker
were objections to the extension method > proposal. > Let's keep this civil, and assume good intentions -- if something is irrelevant, it's irrelevant, but please don't assume that the argument was not made in good faith. For my part I've been following this thread,

[Python-ideas] Re: disallow assignment to unknown ssl.SSLContext attributes

2021-06-25 Thread Christopher Barker
an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/KKBYSXKEFRQ5QVWLGGZWUX475AWLRPFU/ > Code of Conduct: http://python.or

[Python-ideas] Re: pathlib.Path(...).json() (again)

2021-07-09 Thread Christopher Barker
to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/MWTA3BGUWDT74LIFPT47TGUZZIDSB47H/ > Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] Re: writelines2?

2021-07-13 Thread Christopher Barker
;\r\n". And the name IS writeLINES -- so why would anyone expect to use it for anything else -- we still have str.join() after all. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and

[Python-ideas] Re: Nested Dictionary Pointers and Logic - "flatten / nested iteration" Proposal

2021-07-21 Thread Christopher Barker
on.org/mailman3/lists/python-ideas.python.org/ > > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/BRWPYXYXOFJAY7FKEGTFZO5T7XKBSCZ3/ > > Code of Conduct: http://python.org/psf/codeofconduct/ > ___

[Python-ideas] Re: Make __class__ (and maybe other magic variables) visible to functions that was defined outside a class, but then rebound into a class?

2021-07-27 Thread Christopher Barker
gt; To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/GTTD2CSWNCSH2UW657YK3M7GPSUOKWYS/ > Code of Conduct: http://

[Python-ideas] Re: C API for converting Python integers to/from bytes sequences

2021-08-08 Thread Christopher Barker
a what might happen on different platforms. But in any case, thanks for doing this, it's a great idea. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPyth

[Python-ideas] Re: multiprocessing: hybrid CPUs

2021-08-18 Thread Christopher Barker
n-ideas-le...@python.org > > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/UQNSUSHUONT4AO6NJEPEUENQG2AINAMO/ > > Code of Conduct: http://python.org/psf/codeofconduct/ >

[Python-ideas] Re: NAN handling in statistics functions

2021-08-23 Thread Christopher Barker
g > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/EDRF2NR4UOYMSKE64KDI2SWUMKPAJ3YM/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris

[Python-ideas] Re: We should have an explicit concept of emptiness for collections

2021-08-23 Thread Christopher Barker
es/list/python-ideas@python.org/message/IFVHWIOEYST34IVQVOYX7UA45AU6EQ4O/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web D

[Python-ideas] Re: We should have an explicit concept of emptiness for collections

2021-08-24 Thread Christopher Barker
cines from the bloodstreams of the sick; food > from the bellies of the hungry; books from the hands of the > uneducated; technology from the underdeveloped; and putting > advocates of freedom in prisons. Intellectual property is > to the 21st century what the slave trade was to the 16

[Python-ideas] Re: We should have an explicit concept of emptiness for collections

2021-08-24 Thread Christopher Barker
thon.org/message/3FKVLFJLVZIARGNIA7VQBJS3V3BAD3O5/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython

[Python-ideas] Re: We should have an explicit concept of emptiness for collections

2021-08-24 Thread Christopher Barker
nt -- there is no standard way to check emptiness. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas

  1   2   3   4   5   6   7   8   9   >