[Python-ideas] Re: Have del return a value

2023-09-08 Thread Christopher Barker
e. The use case of passing a name into a function (or somewhere else?) and then immediately deleting it is rare indeed -- not worth new syntax. -Chris -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Developme

[Python-ideas] Re: Proposal for get_or function in Python dictionaries

2023-07-17 Thread Christopher Barker
rsation is 20 (!) years too late[*] -- and it did take place then. It's not going to change now. -CHB [*] https://peps.python.org/pep-0308/ -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development

[Python-ideas] Re: "Curated" package repo?

2023-07-09 Thread Christopher Barker
ail 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/J5RH7ZGWO23APG42E6ZU5QPRXMYKJ7W4/ > Code of Conduct: http://python.org/psf/codeofconduct/ >

[Python-ideas] Re: "Curated" package repo?

2023-07-05 Thread Christopher Barker
On Tue, Jul 4, 2023 at 5:49 PM Chris Angelico wrote: > On Wed, 5 Jul 2023 at 10:26, Christopher Barker > wrote: > > The :problem", as I see it. > > > > - The Python standard library is not, and will never be fully > comprehensive -- most projects req

[Python-ideas] Re: "Curated" package repo?

2023-07-05 Thread Christopher Barker
either. > I think to achieve a scalable, funded, decentralized, and trustworthy > package index a DAO makes some amount of sense. > I had to look that up: "Decentralized autonomous organization (DAO)" So, yes. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting

[Python-ideas] "Curated" package repo?

2023-07-04 Thread Christopher Barker
could be a pretty low level of effort, actually. The actual mechanism would be to simply copy it from PyPi once approved -- not that hard to automate. hmmm Probably the biggest challenge would be coming up with the criteria for approval -- not an easy question. And it would require substantial

[Python-ideas] Re: dict method to retrieve a key from a value

2023-07-02 Thread Christopher Barker
ndred such people and you've got something! But critical mass would be hard to get. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___

[Python-ideas] Re: dict method to retrieve a key from a value

2023-07-01 Thread Christopher Barker
On Sat, Jul 1, 2023 at 10:24 PM Chris Angelico wrote: > On Sun, 2 Jul 2023 at 15:11, Christopher Barker > wrote: > > The OP of this thread is not alone -- folks want an authoritative source > -- they may not get that > > An authoritative source is absolutely perfect for som

[Python-ideas] Re: dict method to retrieve a key from a value

2023-07-01 Thread Christopher Barker
ded, which is a start, but a way for the community to highlight the cream of the crop, and everyone to see that would be nice, if it worked. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development

[Python-ideas] Re: dict method to retrieve a key from a value

2023-07-01 Thread Christopher Barker
ly quickly and there's some packages there, maybe something good. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython _

[Python-ideas] Re: dict method to retrieve a key from a value

2023-07-01 Thread Christopher Barker
end 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/OGFJOPQPNV4YH6QPOAJXKDWVIMXNHHIS/ > Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] Re: dict method to retrieve a key from a value

2023-06-30 Thread Christopher Barker
n.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/DPZMOAICSV2YKBYWFSW36LW5GSPZFRNK/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teach

[Python-ideas] Re: dict method to retrieve a key from a value

2023-06-30 Thread Christopher Barker
ived at > https://mail.python.org/archives/list/python-ideas@python.org/message/5EEE27MQZLFYF3HJMFVR3KINPIZB3HRI/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Developmen

[Python-ideas] Re: [dataclasses] add a NON_FIELDS sentinel after which all attributes are ignored.

2023-06-22 Thread Christopher Barker
cified. Then the type annotation is left unadulterated -- much easier for the type checkers. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy,

[Python-ideas] Re: List get/pop

2023-06-16 Thread Christopher Barker
n-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/ITFYOC4KKBGJ2VRFOOYM4

[Python-ideas] Re: Warn when iterating over an already exhausted generator

2023-06-13 Thread Christopher Barker
s://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/RHQWRDV46TPPHTVD5ZRYFHILQM6PZ53T/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, Ph

[Python-ideas] Re: @lazy decorator an alternative to functools.partial ?

2023-05-18 Thread Christopher Barker
GCXXVC6YLWM/ > 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: new PEP: implementation independent native code invocation and data exchange ABI standard (not sure if accurate)

2023-04-23 Thread Christopher Barker
n-ideas@python.org/message/R2NBDZHCCTJNRN27XP7PY7QLKDLYKSAW/ >> Code of Conduct: http://python.org/psf/codeofconduct/ >> > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an emai

[Python-ideas] Re: Can we give built-in `help` function a `__qualname__` attribute

2023-04-10 Thread Christopher Barker
o 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/RJSQTN6DK5GUHTYP2CSZV7FH45IHUC6X/ > Code of Conduct: http://python.org/psf/codeofconduct/ >

[Python-ideas] Re: Native support of YAML in Python STDLIB

2023-03-13 Thread Christopher Barker
@python.org/message/HU755XCIZZBCG6PYCMQQVEUMNUEOHBZQ/ > 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, C

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-21 Thread Christopher Barker
C code — but join() us pretty fundamental:-( -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas mailing

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-21 Thread Christopher Barker
under the hood? Interestingly, neither does the f-string, *if* you include a format > code with lots of room. I guess str.__format__ doesn't always call > __str__(). > Now that you mention that, UserString should perhaps have a __format__, More evidence that it's not really being maintained. Th

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-21 Thread Christopher Barker
as@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/KUNHKJJJTSXNSJRBTGZNIA2TGYM5OE7O/ > Code o

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-21 Thread Christopher Barker
on-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/CCZG6ALFEV3B67LENW5ZDJG5XSHKREG4/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-20 Thread Christopher Barker
On Tue, Dec 20, 2022 at 8:21 PM Stephen J. Turnbull > UserStrings are not instances of str though. I think THAT is a bug. > > I guess, although surely the authors of that class thought about it. Well, kind of — the entire reason for UserString was that at the time, str itself could not be

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-20 Thread Christopher Barker
On Tue, Dec 20, 2022 at 6:20 PM Lucas Wiman wrote: > On Tue, Dec 20, 2022 at 5:38 PM Christopher Barker > wrote: > >> But collections.UserString does exist -- so if you want to subclass, and >> performance isn't critical, then use that. Steven A pointed out that >> Us

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-20 Thread Christopher Barker
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/T7FZ3FIA6INMHQIRVZ3ZZJC

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-18 Thread Christopher Barker
worth more than giving IDEs hints SATO what to do. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas

[Python-ideas] Re: Add copy to pathlib

2022-10-24 Thread Christopher Barker
ct: 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 mailing list -- p

[Python-ideas] Re: Add copy to pathlib

2022-10-18 Thread Christopher Barker
gitHub issues, and of course discuss.python.org, which is where much (most) of these kinds of discussion have moved. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy,

[Python-ideas] Re: Is it possible to provide an official type annotation checker?

2022-10-14 Thread Christopher Barker
. But that gives it a perceived endorsement as an all-Python standard — I’m suggesting that we wouldn’t want to accidentally provide a similar perceived endorsement of a particular static type checker. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software

[Python-ideas] Re: Is it possible to provide an official type annotation checker?

2022-10-13 Thread Christopher Barker
n-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/CG2IGZSV2Z4YMKLPK5MBWK4K4CDYTAFB/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - S

[Python-ideas] Re: Variadic patterns

2022-09-18 Thread Christopher Barker
existing functionality. > This is the key point — and you are quite right. I’ll let others comment on whether this extension to pattern matching makes sense — I haven’t really dig into it enough to have an opinion. -CHB > > Cheers, > Matt > > > On Wed, Sep 14, 2022 at 3:43 PM C

[Python-ideas] Re: Variadic patterns

2022-09-14 Thread Christopher Barker
ifferent place, in a different way. I would be interested in hearing about the use cases you have in mind, and where that fits into the whole type vs value checking continuum. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software

[Python-ideas] Re: Feedback before submission of PEP 661: Sentinel Values

2022-09-11 Thread Christopher Barker
only rows where value is NULL", Good example— wouldn’t it be nice if all the database interaction packages used the same Sentinel for this? In that case it would go in the DB api, but the idea holds. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching

[Python-ideas] Re: Feedback before submission of PEP 661: Sentinel Values

2022-09-10 Thread Christopher Barker
code to use -- a bit like the built-in Exceptions. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas mai

[Python-ideas] Re: A standard library Multiset implementation?

2022-08-20 Thread Christopher Barker
> 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/XIYNOYSBYFPVFXPZTM7O6TENSN5S6Q25/ > Code of Conduct: http:/

[Python-ideas] Re: A standard library Multiset implementation?

2022-08-20 Thread Christopher Barker
r my part, I don’t think I’ve ever had a need for a multiset - so a third party lib is fine. I have no idea if I’m unusual, but that’s the case you’d need to make. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GU

[Python-ideas] Re: range() manipulations

2022-08-01 Thread Christopher Barker
ved at > https://mail.python.org/archives/list/python-ideas@python.org/message/EMDUKIHECPQJETKGYNPJPXT7VV6Y2HCH/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Soft

[Python-ideas] Re: Use 'bin' in virtual environments on Windows

2022-07-21 Thread Christopher Barker
age/JZZ6QJVEJBC4TZF6SUBWD3TUK2RHIRTW/ > 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: Dataclasses for complex models, A proposal for datatrees,

2022-07-15 Thread Christopher Barker
/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/7XPPPC63XVXFIXP2WIT6ARRX7CTYPRSX/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching

[Python-ideas] Re: Add a line_offsets() method to str

2022-06-20 Thread Christopher Barker
( with extraneous “\r”s in the substrings… -CHB On Mon, Jun 20, 2022 at 5:04 PM Christopher Barker wrote: > If you are working with bytes, then numpy could be perfect— not a small > dependency of course, but it should work, and work fast. > > And a cython method would be quite easy to write, b

[Python-ideas] Re: Add a line_offsets() method to str

2022-06-20 Thread Christopher Barker
t; > ___ > 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 &

[Python-ideas] Re: Add a line_offsets() method to str

2022-06-19 Thread Christopher Barker
d 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/AETGT5HDF3QOFODOWKB4X45ZE4CZ7Y3M/ > Code of Conduct: http://python.org/psf/codeofconduct/ &g

[Python-ideas] Re: Add a line_offsets() method to str

2022-06-18 Thread Christopher Barker
ilman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/6WAMKYXOYA3SKL5HIRZP4WARMYYKXI3Q/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Con

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

2022-06-17 Thread Christopher Barker
gt; You have just articulated why I find type annotations so hard to read. Back OT: add annotations to the examples, and it gets worse. I like it or not, I suspect annotations are becoming “standard” -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific So

[Python-ideas] Re: Add .except() and .only(), and .values_at(). instance methods to dict

2022-06-06 Thread Christopher Barker
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/ETCU6O7QGERUFQND5XRBLGHV5OT4CNT3/ > Code of Conduct: http://python.org/

[Python-ideas] Re: Addition to fnmatch.py

2022-06-06 Thread Christopher Barker
ython.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/WZFC3WAOMTQ2UQIMGBJ2VTBBOE5XUWBR/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Ch

[Python-ideas] Re: Python array multiplication for negative values should throw an error

2022-05-31 Thread Christopher Barker
was going to be the first — and that’s been delayed. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas

[Python-ideas] Re: TextIOBase: Make tell() and seek() pythonic

2022-05-26 Thread Christopher Barker
SZDIZATQDGLXRZVSUSQWBQJ2UUTJ/ > 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: `importlib.resources` access whole directories as resources

2022-05-18 Thread Christopher Barker
e], name: str) -> bool Docstring: True if 'name' is a resource inside 'package'. Directories are *not* resources. And check this out: In [6]: resources.is_resource('importlib','__init__.py') Out[6]: True So the __init__.py file is a resource. and: In [9]: resources.is_resource('importlib','met

[Python-ideas] Re: `importlib.resources` access whole directories as resources

2022-05-16 Thread Christopher Barker
want to store resources. After all, if you want to put modules in a nested dir, you have to add a __init__.py to the dir as well. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPyth

[Python-ideas] Re: `importlib.resources` access whole directories as resources

2022-05-16 Thread Christopher Barker
On Sun, May 15, 2022 at 11:57 PM Greg Ewing wrote: > On 16/05/22 5:05 pm, Christopher Barker wrote: > > a directory is not a binary artifact -- it can't have actually data in > > it like a file can. > > and: > > > the entire > > point of resources is to prov

[Python-ideas] Re: `importlib.resources` access whole directories as resources

2022-05-15 Thread Christopher Barker
owed so that when it is known that the package and resources are stored on the file system then those subdirectory names can be used directly. """ which implies to me that the system is expected to optionally handle subdirs. Perhaps you can write a ResourceResader that meets your needs, and it

[Python-ideas] Re: Heterogeneous numeric data in statistics library

2022-05-14 Thread Christopher Barker
tions. But no matter how you slide it, if the types are not homogenous, then there will be some loss of some sort. Which is why I think it's better to make it explicit. It's actually hard for me to imagine a case where someone would have mixed types that wasn't an accident -- another reason to be explicit.

[Python-ideas] Fwd: Re: Heterogeneous numeric data in statistics library

2022-05-14 Thread Christopher Barker
accidentally sent off list. -CHB -- Forwarded message - From: Christopher Barker Date: Fri, May 13, 2022 at 8:14 PM Subject: Re: [Python-ideas] Re: Heterogeneous numeric data in statistics library To: Cameron Simpson On Thu, May 12, 2022 at 5:06 PM Cameron Simpson

[Python-ideas] Re: New Tool Proposal

2022-05-10 Thread Christopher Barker
that there is actually a lot to be done, if you want the general case. What do you expect you'd get with the OP's suggestion? You might get the basic set up code, but that's actually not the hard part of a C extension anyway. I'm not sure it would buy you much. -CHB -- Christopher Barker,

[Python-ideas] Re: New Tool Proposal

2022-05-10 Thread Christopher Barker
nge, because Python types really are different than C types -- it's not always obvious what you want. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, s

[Python-ideas] Re: Time to relax some restrictions on the walrus operator?

2022-05-08 Thread Christopher Barker
; https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/S7MU7ONVRAVYPXYTYMRGW32NYU3L7RIE/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Pyt

[Python-ideas] Re: Adding a .find() method to list

2022-05-07 Thread Christopher Barker
customize your matching function, you might as just write the code. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___

[Python-ideas] Re: Auto assignment of attributes

2022-05-07 Thread Christopher Barker
r methods, and it might even be useful in other contexts [*]. I think: def fun(x, y.z): ... would work fine, too. e.g. you wouldn't be restricted to using other parameters. That being said, I'm still -1 on the idea. [*] -- the "other contexts" is key for me -- if someone can show t

[Python-ideas] Re: Auto assignment of attributes

2022-05-04 Thread Christopher Barker
Bringing this back on list -- I hope that was an accident. (NOTE: getting a touch off-topic here -- but I do bring it back around at the end) On Wed, May 4, 2022 at 4:38 AM Paul Moore wrote: > On Tue, 3 May 2022 at 17:46, Christopher Barker > wrote: > > On Tue, May 3, 2022 at

[Python-ideas] Re: Auto assignment of attributes

2022-05-03 Thread Christopher Barker
Sorry - auto-correct is not my friend :-( -CHB On Tue, May 3, 2022 at 12:07 PM Ethan Furman wrote: > On 5/2/22 23:21, Christopher Barker wrote: > > > But yes, there are many use cases not suited to dataclasses. The > question is how many of these would > > rap pa

[Python-ideas] Re: Auto assignment of attributes

2022-05-03 Thread Christopher Barker
On Mon, May 2, 2022 at 9:30 PM Joao S. O. Bueno wrote: > Anyway, there is something dataclasses do today that prevent you from jsut > adding a @dataclass for binding __init__ attributes from an otherwise > "complete class that does things": > I nor anyone else ever claimed dataclasses could be

[Python-ideas] Re: Auto assignment of attributes

2022-05-02 Thread Christopher Barker
On Mon, May 2, 2022 at 7:42 PM Steven D'Aprano wrote: > On Sun, May 01, 2022 at 10:40:49PM -0700, Christopher Barker wrote: > > > Yes, any class could use this feature (though it's more limited than > what > > dataclasses do) -- what I was getting is is that it would not

[Python-ideas] Re: Auto assignment of attributes

2022-05-01 Thread Christopher Barker
On Sun, May 1, 2022 at 1:16 AM Steven D'Aprano wrote: > > > On Sat, Apr 23, 2022 at 12:11:07PM -0700, Christopher Barker wrote: > > > > Absolutely. However, this is not an "all Classes" question. > > > Isn't it? I thought this was a proposal to allow any c

[Python-ideas] Re: Auto assignment of attributes

2022-05-01 Thread Christopher Barker
y: positional vs keyword *args, **kwargs keyword-only. (and all of these from both the caller and callee perspective) That's a lot of possible combinations -- believe me, it's pretty darn complex and hard to explain! -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teachi

[Python-ideas] Re: Auto assignment of attributes

2022-05-01 Thread Christopher Barker
On Sat, Apr 30, 2022 at 6:40 PM Steven D'Aprano wrote: > On Sat, Apr 23, 2022 at 12:11:07PM -0700, Christopher Barker wrote: > > Absolutely. However, this is not an "all Classes" question. > > Isn't it? I thought this was a proposal to allow any class to partake in >

[Python-ideas] Re: Auto assignment of attributes

2022-04-29 Thread Christopher Barker
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/76GFMSU7OVG3GMFXD52TJFSPG47N2QLR/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher

[Python-ideas] Re: Auto assignment of attributes

2022-04-28 Thread Christopher Barker
arameters, mutable and immutable. Anyway, I just thought it should be clearly said. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython _

[Python-ideas] Re: Auto assignment of attributes

2022-04-23 Thread Christopher Barker
nything special, or "don't do that"? -CHB -- 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: mro and super don't feel so pythonic

2022-04-21 Thread Christopher Barker
the API of a class hierarchy. Indeed, the MRO of a class hierarchy is part of the API. If you change the MRO, it is a potentially breaking change, just as if a method is added or removed, or renamed, or ... Nothing to see here -- this is all deliberate, and useful. -CHB -- Christopher B

[Python-ideas] Re: Auto assignment of attributes

2022-04-18 Thread Christopher Barker
nt it for lambda functions. >> >> Cheers, >> >> Pablo and Quimey >> >> ___ >> Python-ideas mailing list -- python-ideas@python.org >> To unsubscribe send an email to python-ideas-le...@python.org >> h

[Python-ideas] Re: Native support for units [was: custom literals]

2022-04-12 Thread Christopher Barker
s that want units built in to Python is "what's so hard about that? Ricky wrote: "Python is so painful to use for units I've actually avoided it," Really? have you tried pint? or anything else? what is so painful about this? -CHB -- Christopher Barker, PhD (Chris) Python Language

[Python-ideas] Re: Custom literals, a la C++

2022-04-12 Thread Christopher Barker
ng on here: when I write code that may be run in the context of someone else's "application" (or my own, two years later :-) ) -- I want to know exactly what the unit calculations will mean, and that they won't be messed with at run time by a standard recommended practice. -CHB -- Christophe

[Python-ideas] Re: Custom literals, a la C++

2022-04-11 Thread Christopher Barker
is a bad idea. What I'm not suggesting, because I think it wouldn't be that helpful, and maybe not possible would be to have something like: set_units_registry_to(my_units system) and then have: distance = 500[miles] use my_units_system's definition of miles in that module without having explici

[Python-ideas] Re: Custom literals, a la C++

2022-04-11 Thread Christopher Barker
ng dir is global — not a good choice. The module-scope hammer does not fit every nail. Stop trying to hammer > in screws. I don’t know about anyone else, but I’m not arguing for module scope. I’m arguing against implicit global configuration. -CHB -- Christopher Barker, PhD (Chris) Python

[Python-ideas] Re: Custom literals, a la C++

2022-04-10 Thread Christopher Barker
ll break when it's used in a different context. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas mailin

[Python-ideas] Re: Custom literals, a la C++

2022-04-10 Thread Christopher Barker
ere's no point trying to make this scoped, just as we don't have > lots of other things scoped (like sys.modules). Shared state across > the application is a *good* thing, not a bad one. > Not in this case, it isn't (IMHO :-; ) -CHB -- Christopher Barker, PhD (Chris) Python La

[Python-ideas] Re: Custom literals, a la C++

2022-04-10 Thread Christopher Barker
ld make a lot of sense to > offer an easy way to register all of your library's units with the > system repository, thus making them all available; but that would be > completely optional to both you and your users. > But if I did that, then one lib registering my units with the globa

[Python-ideas] Re: Native support for units [was: custom literals]

2022-04-09 Thread Christopher Barker
wrote: > This message is for those that would like to "play" with a more natural > looking syntax for units in Python. > This is very cool -- thanks! -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development -

[Python-ideas] Re: Native support for units [was: custom literals]

2022-04-09 Thread Christopher Barker
lab.research.google.com/github/agile-geoscience/xlines/blob/master/notebooks/13_Physical_units_with_pint.ipynb -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Developmen

[Python-ideas] Re: Custom literals, a la C++

2022-04-08 Thread Christopher Barker
me make all sorts of arbitrary decisions about what "mile" and "oz" and all that means, and it's not going to get broken by someone else that prefers different uses -- at least if they use the public API. -CHB -- Christopher Barker, PhD (Chris) Python Language Consu

[Python-ideas] Re: Giving Decimal a global context was a mistake?

2022-04-08 Thread Christopher Barker
g. The legend goes that he was only caught because the bank had a promotional event in which they drew a randomly selected account -- and found his. Are you SURE your accounting software is doing the right thing? ;-) -CHB Also -- if it uses 64 bit floats, it'll have problems with trillions of d

[Python-ideas] Re: Giving Decimal a global context was a mistake?

2022-04-07 Thread Christopher Barker
in that package -- not any global setting that a user of the package, or some other package, might mess with? So what's the point of a global context? Isn't it an accident waiting to happen? -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific

[Python-ideas] Re: Native support for units [was: custom literals]

2022-04-07 Thread Christopher Barker
ndard type system, and in fact, are moving towards breaking other uses of annotations. Let's not go down that path again. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development -

[Python-ideas] Re: Giving Decimal a global context was a mistake?

2022-04-06 Thread Christopher Barker
e is using Decimals -- let alone two different third party packages using them in very different ways -- it's literally impossible for the developer of package A to know how package B works or that someone might be using both. Then put all this behind a multithreading web server, and you have a re

[Python-ideas] Re: Native support for units [was: custom literals]

2022-04-05 Thread Christopher Barker
head, or setting it on a dividers, but you ARE measuring distance in latitude minutes. [2] https://en.wikipedia.org/wiki/API_gravity -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, nump

[Python-ideas] Re: Native support for units [was: custom literals]

2022-04-05 Thread Christopher Barker
de, where 1 minute is a nautical mile. But anyway, a humorous one-off. But it makes the point that there is no one way to handle units that works for everyone. An astonishing amount of “real work” is done with “squishy” units. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teach

[Python-ideas] Re: Native support for units [was: custom literals]

2022-04-05 Thread Christopher Barker
ferent units :-) -CHB -- 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-idea

[Python-ideas] Re: s?scanf [was: A string function idea]

2022-03-30 Thread Christopher Barker
-CHB -- 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@python.org To unsubscrib

[Python-ideas] Re: s?scanf [was: A string function idea]

2022-03-30 Thread Christopher Barker
ed at > https://mail.python.org/archives/list/python-ideas@python.org/message/ZJJPUWUUCWFRAZYNG46EFH3LFG7RZB6A/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development -

[Python-ideas] Re: A string function idea

2022-03-29 Thread Christopher Barker
nto a slower, more fragile, harder to understand, less user-friendly > regex. > I do agree there. I also agree with Chris A's suggestion: *some* scanner / parser that could be used for this and many other things that's significantly more straightforward that regex's. -CHB -- Christopher

[Python-ideas] Re: Anonymous namedtuples, revisited

2022-03-29 Thread Christopher Barker
deas@python.org/message/QM7MIHKP2GSBN6TYMPDIFKGHGC7KEH6E/ > 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,

[Python-ideas] Re: Anonymous namedtuples, revisited

2022-03-29 Thread Christopher Barker
y for that horrible name ;-) ), but apparently you can't use __slots__ in a tuple subclass ('cause tuple's already using it ??) -- but that could be done in a builtin. then it wouldn't need a __dict__ There's also various options for storing the fields -- I only tried the first one I thought of. This remin

[Python-ideas] Re: Anonymous namedtuples, revisited

2022-03-29 Thread Christopher Barker
too if you wanted. Anyway -- that's in idea -- details to be fleshed out if anyone wanted to pursue this. -CHB On Sat, Mar 26, 2022 at 1:49 PM Christopher Barker wrote: > > If I wanted to submit this as a pep (or even just submit this for a >> potential sponsorship), is the best way

[Python-ideas] Re: mro and super don't feel so pythonic

2022-03-28 Thread Christopher Barker
n, which would also work. mixins are great when you have multiple features that you need to mix and match in various ways. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and

[Python-ideas] Re: mro and super don't feel so pythonic

2022-03-26 Thread Christopher Barker
ful” and “super considered helpful” — the thing is, they both say the same thing— in order for super() to work you have to follow certain rules. And then it works predictably. Whether that’s helpful or not depends on your use case. -CHB -- Christopher Barker, PhD (Chris) Python Language Consultin

[Python-ideas] Re: Anonymous namedtuples, revisited

2022-03-26 Thread Christopher Barker
ython-ideas@python.org/message/Q6JTO37I42OKOAIJVBD63UL5QO3KEYLI/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Developmen

[Python-ideas] Re: mro and super don't feel so pythonic

2022-03-26 Thread Christopher Barker
deas-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/NH5JOZUHEN7TPNCFDQKJXFJHXQL6MTI2/ > Code of Conduct: http://python.org/psf/codeofconduct/ >

  1   2   3   4   5   6   7   8   9   >