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

2021-02-23 Thread Wes Turner
On 2/23/21, Random832 wrote: > I was reading a discussion thread > about > various issues with the Debian packaged version of Python, and the following > statement stood out for me as shocking: > > Christian Heimes wrote: >> Core dev

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

2021-02-23 Thread Wes Turner
hat doesn't get called as frequently as `apt-get upgrade -y`: ```bash pip install -U certifi ``` https://github.com/certifi/python-certifi (Mozilla's CA bundle extracted into a Python package) ```bash apt-get install -y ca-certificates dnf install -y ca-certificates ``` On 2/24/21, Wes

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

2021-02-28 Thread Wes Turner
Is there a tool that (1) detects import name collisions; and (2) attempts to read package metadata and package file checksums (maybe from the ZIP 'manifest')? In order to: - troubleshoot module shadowing issues - $PATH - sys.path - `python -m site` - incomplete and overlapping uninstall

[Python-ideas] Re: Namespaces!

2021-05-05 Thread Wes Turner
On Wed, May 5, 2021, 02:11 Steven D'Aprano wrote: > My comments follow, interleaved with Matt's. > > > On Mon, May 03, 2021 at 11:30:51PM +0100, Matt del Valle wrote: > > > But you've pretty much perfectly identified the benefits here, I'll just > > elaborate on them a bit. > > > > - the indentat

[Python-ideas] Re: Introduce constant variables in Python

2021-06-17 Thread Wes Turner
On Mon, May 24, 2021 at 5:43 PM Chris Angelico wrote: > > Requiring that a name not be rebound is well-defined and testable. > Requiring that an object not change is either trivial (in the case of, > say, an integer) or virtually impossible (in the case of most > objects). > What would be the a

[Python-ideas] Re: Introduce constant variables in Python

2021-06-17 Thread Wes Turner
On Thu, Jun 17, 2021 at 10:50 AM Chris Angelico wrote: > On Fri, Jun 18, 2021 at 12:43 AM Wes Turner wrote: > > > > > What would be the advantage of such a declaration? > > > > Constants don't need to be locked or unlocked; which is advantageous for > p

[Python-ideas] Re: joining paths without worrying about a leading slash

2021-06-27 Thread Wes Turner
"[Python-ideas] Sanitize filename (path part) 2nd try" https://mail.python.org/archives/list/python-ideas@python.org/thread/LRIKMG3G4I4YQNK6BTU7MICHT7X67MEF/ "[Python-ideas] Sanitize filename (path part)" https://mail.python.org/archives/list/python-ideas@python.org/thread/SQH4LPERFLKBLXPDUOVJMV24

[Python-ideas] Re: joining paths without worrying about a leading slash

2021-06-28 Thread Wes Turner
ithub.com/westurner/pgs/blob/master/pgs/app.py#L60-L95 On Mon, Jun 28, 2021, 04:09 Zbigniew Jędrzejewski-Szmek wrote: > On Sun, Jun 27, 2021 at 09:55:34PM -0400, Wes Turner wrote: > > "[Python-ideas] Sanitize filename (path part) 2nd try" > > > https://mail.python.or

[Python-ideas] Re: Add @parametrize decorator to unittest library

2021-09-07 Thread Wes Turner
unittest.subTest, hypothesis @given + pytest From https://docs.python.org/3/library/unittest.html#distinguishing-test-iterations-using-subtests : ``` When there are very small differences among your tests, for instance some parameters, unittest allows you to distinguish them inside the body of a t

[Python-ideas] RFC: New/update the Docs Sphinx theme: responsive, edit page links,

2021-09-22 Thread Wes Turner
Where would be the best place to discuss or just improve the CPython docs sphinx theme? What would Python need in a {PyData,} Sphinx theme fork: - [ ] ENH: add links to every docs page - [ ] ENH: responsive breakpoints for mobile devices - [ ] ENH: responsive fonts - [ ] ENH: toggle-able dark th

Re: [Python-ideas] Python certification

2018-08-09 Thread Wes Turner
edu-sig may be a good list for such a discussion; though you may find more information on Python lessons aligned with CS/Science curriculum standards than professional certification. https://mail.python.org/mailman/listinfo/edu-sig > This list is for discussion of Python in education, however (at

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

2018-08-20 Thread Wes Turner
pycontracts may be worth a look. https://andreacensi.github.io/contracts/ - @contract decorator, annotations, docstrings IDK if pycontracts supports runtime parameter validations that involve more than one parameter. Inheritance does appear to be supported, as are numpy array dimension constrai

Re: [Python-ideas] REPL features

2018-08-22 Thread Wes Turner
%edit -p > Bring up an editor and execute the resulting code. > -p: this will call the editor with the same data as the previous time it was used, regardless of how long ago (in your current session) it was. https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-edit Something l

Re: [Python-ideas] REPL features

2018-08-22 Thread Wes Turner
%doctest_mode works like the Python REPL (with '>>>' prompts and no pretty printing) https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-doctest_mode On Wednesday, August 22, 2018, Wes Turner wrote: > %edit -p > > > Bring up an editor and execu

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

2018-08-24 Thread Wes Turner
On Thursday, August 23, 2018, Jonathan Fine wrote: > Hi Mike > > Thank you for your prompt response. You wrote > > > Maybe we're on different planes? > > > > I'm talking about 5 lines of Python code to get a custom layout GUI on > the screen: > > > > import PySimpleGUI as sg > > > > form = sg.Fle

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

2018-08-24 Thread Wes Turner
https://docs.python-guide.org/scenarios/gui/ lists a bunch of great GUI projects for Python. https://github.com/realpython/python-guide/blob/master/docs/scenarios/gui.rst On Friday, August 24, 2018, Wes Turner wrote: > > > On Thursday, August 23, 2018, Jonathan Fine wrote: >

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

2018-08-24 Thread Wes Turner
On Friday, August 24, 2018, Terry Reedy wrote: > On 8/24/2018 4:12 AM, Wes Turner wrote: > > There was a thread about deprecating Tk awhile back. >> > > That was an intentionally annoying troll post, not a serious proposal. > Please don't refer to it as if it wer

Re: [Python-ideas] A GUI for beginners and experts alike (Mike Barnett)

2018-08-24 Thread Wes Turner
Accessibility is a very real advantage of Qt solutions. http://doc.qt.io/qt-5/accessible.html """ [...] applications usable for people with different abilities. It is important to take different people's needs into account, for example, in case of low vision, hearing, dexterity, or cognitive prob

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

2018-08-24 Thread Wes Turner
adonly=True) main_box.add(self.n1_input) main_box.add(self.n2_input) main_box.add(self.n3_input) # Add the content on the main window self.main_window.content = main_box # Show the main window self.main_window.show() def main(): return To

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

2018-08-27 Thread Wes Turner
Runtime checks: data validation & code validation Compile-time checks: code validation What sort of data validation is appropriate for assert statements or contacts that may be skipped due to trading performance for more risk ('optimized out')? Checking the value of a Number? Checking that a large

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

2018-08-27 Thread Wes Turner
8, Steven D'Aprano wrote: > On Mon, Aug 27, 2018 at 11:01:21AM -0400, Wes Turner wrote: > > Runtime checks: data validation & code validation > > Compile-time checks: code validation > > > > What sort of data validation is appropriate for assert statements or &g

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

2018-08-28 Thread Wes Turner
ight want > to weaken the requirements (*e.g., *a ROI that can deal with pixels > outside of an image) such that x and y can be an arbitrary numbers, not > restricted to 0 <= x < img.width and 0 <= y < img.height respectively. > > Additionally, without standard approa

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

2018-08-28 Thread Wes Turner
How are conditions relaxed/overridden in Eiffel without a named reference? That looks much more readable. Expressions within such blocks are implicitly assertTrue(s). What sort of test generation from said nameless expressions would be most helpful? On Tuesday, August 28, 2018, Steven D'Aprano

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

2018-08-30 Thread Wes Turner
def example_func(x, y): def __assert_before__(example_func): #implicit, AST-able assertion expressions # ... code def __assert_after__(example_func): # def __assert_after__invariants_02(example_func): # " But these need to be composed / mixed in in MRO or

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

2018-09-02 Thread Wes Turner
On Sunday, September 2, 2018, Zaur Shibzukhov wrote: > > > --- > *Zaur Shibzukhov* > > > 2018-09-02 22:11 GMT+03:00 Wes Turner : > >> Does the value of __hash__ change when attributes of a recordclass change? >> > > Currently recordclass's __hash__

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

2018-09-03 Thread Wes Turner
Rationale = - Separation of executable code and non-executable data is a good thing. - Additional security in Python is a good idea. - Python should support things like the NX bit to separate code and non-executable data. Discussion == How could Python implement support for the NX

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

2018-09-03 Thread Wes Turner
On Mon, Sep 3, 2018 at 3:25 AM Jacco van Dorp wrote: > This feels really useful to me to make some quick changes to a database - > perhaps a database layer could return an class of type Recordclass, and > then you just simply mutate it and shove it back into the database. > Pseudocode: > > record

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

2018-09-03 Thread Wes Turner
On Mon, Sep 3, 2018 at 4:17 AM Chris Angelico wrote: > On Mon, Sep 3, 2018 at 5:23 PM, Jacco van Dorp > wrote: > > This feels really useful to me to make some quick changes to a database - > > perhaps a database layer could return an class of type Recordclass, and > then > > you just simply muta

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

2018-09-03 Thread Wes Turner
On Mon, Sep 3, 2018 at 4:40 AM Chris Angelico wrote: > On Mon, Sep 3, 2018 at 6:31 PM, Wes Turner wrote: > > > > > > On Mon, Sep 3, 2018 at 4:17 AM Chris Angelico wrote: > >> > >> On Mon, Sep 3, 2018 at 5:23 PM, Jacco van Dorp > >> wrote: &g

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

2018-09-03 Thread Wes Turner
So, if an application accepts user-supplied input (such as a JSON payload), is that data marked as non-executable? On Monday, September 3, 2018, Greg Ewing wrote: > Jonathan Fine wrote: > > # Evil code! > >> ask_delete.__code__, ask_save.__code__ = ask_save.__code__, >> ask_delete.__co

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

2018-09-03 Thread Wes Turner
On Monday, September 3, 2018, Cameron Simpson wrote: > On 03Sep2018 20:58, Wes Turner wrote: > >> So, if an application accepts user-supplied input (such as a JSON >> payload), >> is that data marked as non-executable? >> > > Unless you've hacked t

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

2018-09-04 Thread Wes Turner
compile time, so you can try compiling Python yourself > with different compiler flags and see what other configurations are > possible. Some mitigations hurt performance and others may be incompatible > with Python itself. If you search on bugs.python.org you'll find a few >

Re: [Python-ideas] Retire or reword the namesake of the Language

2018-09-16 Thread Wes Turner
There's already a thing named Cobra. https://github.com/opencobra/cobrapy "Python (mythology)" https://en.wikipedia.org/wiki/Python_(mythology) ... Serpent/Dragon guarding the omphalos. "Ouroboros" https://en.wikipedia.org/wiki/Ouroboros Monty Python themed Python language things: - The Che

Re: [Python-ideas] Retire or reword the namesake of the Language

2018-09-16 Thread Wes Turner
Anyways, speaking of dragons, here are some ideas for new logos: "Strong Bad Email #58: Dragon" https://youtu.be/90X5NJleYJQ https://en.wikipedia.org/wiki/Monty_Python On Sunday, September 16, 2018, Wes Turner wrote: > There's already a thing named Cobra. > > http

[Python-ideas] SEC: Spectre variant 2: GCC: -mindirect-branch=thunk -mindirect-branch-register

2018-09-16 Thread Wes Turner
5.7 and later. https://docs.microsoft.com/en-us/cpp/build/reference/qspectre?view=vs-2017 security@ directed me to the issue tracker / lists, so I'm forwarding this to python-dev and python-ideas, as well. # Forwarded message From: *Wes Turner* Date: Wednesday, September 12, 2018 Subj

Re: [Python-ideas] SEC: Spectre variant 2: GCC: -mindirect-branch=thunk -mindirect-branch-register

2018-09-16 Thread Wes Turner
On Sunday, September 16, 2018, Wes Turner wrote: > Should Python builds add `-mindirect-branch=thunk > -mindirect-branch-register` to CFLAGS? > > Where would this be to be added in the build scripts with which > architectures? > > /QSpectre is the MSVC build flag for Spectre

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

2018-09-16 Thread Wes Turner
On Saturday, September 15, 2018, Franklin? Lee < leewangzhong+pyt...@gmail.com> wrote: > I am very disappointed with the responses to this thread. We have > mockery, dismissiveness, and even insinuations about OP's > psychological health. Whether or not OP is a troll, and whether or not > OP's ide

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

2018-09-16 Thread Wes Turner
On Sunday, September 16, 2018, Wes Turner wrote: > > It may be most relevant to interpret the poem as it is: culled from > various writings of the community. > > What do we need to remember? Our criticism can hurt fragile feelings and > egos; which we need to check at the do

Re: [Python-ideas] SEC: Spectre variant 2: GCC: -mindirect-branch=thunk -mindirect-branch-register

2018-09-16 Thread Wes Turner
ps://mail.python.org/pipermail/python-ideas/2018-September/053175.html > ~ Do trampolines / nested functions in C extensions switch off the NX bit? On Sunday, September 16, 2018, Nathaniel Smith wrote: > On Wed, Sep 12, 2018, 12:29 Joni Orponen wrote: > >> On Wed, Sep 12, 2018 at 8:48

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

2018-09-17 Thread Wes Turner
than ugly" was the CoC in the Python community for many years; so, now that the CoC is in place, the best thing to do may be to just remove the Zen of Python entirely; rather than dominate the authors' sarcastic poem until it's devoid of its intentional tone. On Sunday, September

Re: [Python-ideas] PEPs: Theory of operation [was: Moving to another forum system ...]

2018-09-22 Thread Wes Turner
Process suggestions that could minimize non-BDFL's BDFL legwork: * https://github.com/python/peps * https://github.com/pypa/interoperability-peps * Use GitHub reactions for voting on BDFL delegates, PEP final approval, and PEP sub issues? * Specify a voting deadline? * How to make a quorum ca

Re: [Python-ideas] PEPs: Theory of operation [was: Moving to another forum system ...]

2018-09-22 Thread Wes Turner
On Saturday, September 22, 2018, Wes Turner wrote: > > It seems like everything's fine, but I would have no idea, BTW > Would project boards be helpful for coordinating proposal status information, or extra process for something that's already working just fine? https://git

Re: [Python-ideas] PEPs: Theory of operation [was: Moving to another forum system ...]

2018-09-22 Thread Wes Turner
) https://devguide.python.org/#contributing https://devguide.python.org/experts/ - is there a different BDFL-delegate org chart, or would this be the page to add to and refer to? On Saturday, September 22, 2018, Wes Turner wrote: > > > On Saturday, September 22, 2018, Wes Turner wrote: &

Re: [Python-ideas] JS’ governance model is worth inspecting

2018-09-24 Thread Wes Turner
On Thursday, September 20, 2018, James Lu wrote: > JS’ decisions are made by a body known as TC39, a fairly/very small group > of JS implementers. https://github.com/tc39/ Python has devs with committer privileges: https://devguide.python.org/experts/ There are maintainers for many modules: h

Re: [Python-ideas] Upgrade to Mailman 3

2018-09-30 Thread Wes Turner
re: message URL in mm3 footers (after sig dashes: '\n--\n') "This list will soon be migrating to Mailman 3" https://mail.python.org/mm3/archives/list/distutils-...@python.org/thread/IHWUGVND3FU2UH3GEC2GYOSOJJMKLO5H/ On Sunday, September 30, 2018, James Lu wrote: > It has a nice GUI for people w

Re: [Python-ideas] PEPs: Theory of operation [was: Moving to another forum system ...]

2018-10-03 Thread Wes Turner
On Saturday, September 22, 2018, Wes Turner wrote: > Here are links to the Apache governance docs: > > https://www.apache.org/foundation/governance/#technical > > https://www.apache.org/foundation/governance/pmcs.html > > Which are the PSF docs for these exact same proc

Re: [Python-ideas] PEPs: Theory of operation [was: Moving to another forum system ...]

2018-10-03 Thread Wes Turner
re: Updating the BDFL-Delegate policy (in PEP 1) On Wednesday, October 3, 2018, Wes Turner wrote: > > > On Saturday, September 22, 2018, Wes Turner wrote: > >> [...] >> >> https://devguide.python.org/#contributing >> >> https://devguide.python.o

Re: [Python-ideas] Powerset

2018-10-15 Thread Wes Turner
Is there a name for an iteration of the powerset which is more useful for binary search? I.e. instead of starting with null set, start with the "middle" ( r/2 ). Maybe a bit OT, but is there a name for such a combinatorial search? On Monday, October 15, 2018, Hasan Diwan wrote: > > This is cert

Re: [Python-ideas] Powerset

2018-10-16 Thread Wes Turner
On Tuesday, October 16, 2018, Greg Ewing wrote: > Wes Turner wrote: > >> Is there a name for an iteration of the powerset which is more useful for >> binary search? I.e. instead of starting with null set, start with the >> "middle" ( r/2 ). >> > >

Re: [Python-ideas] Serialization of CSV vs. JSON

2018-11-02 Thread Wes Turner
JSON-LD supports datetimes (as e.g. IS8601 xsd:datetimes) https://www.w3.org/TR/json-ld11/#typed-values Jsonpickle (Python, JS, ) supports datetimes, numpy arrays, pandas dataframes https://github.com/jsonpickle/jsonpickle JSON5 supports comments in JSON. https://github.com/json5/json5/issues/3

Re: [Python-ideas] Serialization of CSV vs. JSON

2018-11-03 Thread Wes Turner
jsondate, for example, supports both .load[s]() and .dump[s](); but only for UTC datetimes https://github.com/rconradharris/jsondate/blob/master/jsondate/__init__.py UTC is only sometimes a fair assumption; otherwise it's dangerous to assume that timezone-naieve [ISO8601] strings represent UTC-0

Re: [Python-ideas] Serialization of CSV vs. JSON

2018-11-04 Thread Wes Turner
Here's a JSONEncoder subclass with a default method that checks variable types in a defined sequence that includes datetime: https://gist.github.com/majgis/4200488 Passing an ordered map of (Type, fn) may or may not be any more readable than simply subclassing JSONEncoder and defining .default().

Re: [Python-ideas] kwargs for return

2019-01-26 Thread Wes Turner
On Saturday, January 26, 2019, Steven D'Aprano wrote: > > > Perhaps you should start by telling us *precisely* what the problem is > that your subclass will solve. Because I don't know what your idea of > dict unpacking is, and how it compares or differs from previous times it > has been proposed.

Re: [Python-ideas] kwargs for return

2019-01-26 Thread Wes Turner
On Saturday, January 26, 2019, David Mertz wrote: > I was going to write exactly they're same idea Steven did. > > Right now you can simply design APIs to return dictionaries or, maybe > better, namedtuples. Namedtuples are really nice since you can define new > attributes when you upgrade an API

Re: [Python-ideas] Suggestions: dict.flow_update and dict.__add__

2019-03-05 Thread Wes Turner
dicttoolz has functions for working with these objects; including dicttoolz.merge (which returns a reference to the merged dicts but does not mutate the arguments passed). https://toolz.readthedocs.io/en/latest/api.html#dicttoolz https://toolz.readthedocs.io/en/latest/api.html#toolz.dicttoolz.mer

Re: [Python-ideas] Allow creation of polymorph function (async function executable syncronously)

2019-03-05 Thread Wes Turner
Is this what syncer does with a sync() function? Why isn't this a built-in? https://github.com/miyakogi/syncer On Wednesday, March 6, 2019, Nathaniel Smith wrote: > Defining a single polymorphic function is easy at the library level. > For example, with asyncio: > > > > def maybe_async(fn)

Re: [Python-ideas] Allow creation of polymorph function (async function executable syncronously)

2019-03-06 Thread Wes Turner
Here's syncer/syncer.py: https://github.com/miyakogi/syncer/blob/master/syncer.py I think the singledispatch is pretty cool. ```python #!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from functools import singledispatch, wraps import asyncio import inspect import types from typing impo

Re: [Python-ideas] True and False are singletons

2019-03-18 Thread Wes Turner
'True' is a keyword. (Which is now immutable in Python 3.X?) >>> True = 1 File "", line 1 SyntaxError: can't assign to keyword https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy https://docs.python.org/3/search.html?q=singleton - "Since None is a singleton, testing

[Python-ideas] Re: JSON encoder protocol (was Re: adding support for a "raw output" in JSON serializer)

2019-08-14 Thread Wes Turner
There's JSON5; which supports comments, trailing commas, IEEE 754 ±Infinity and NaN, [...] https://json5.org/ There's also JSON-LD, which supports xsd:datetime, everything that can be expressed as RDF, @context vocabulary, compact and expanded representations, @id, and lots of other cool features

[Python-ideas] Re: JSON encoder protocol (was Re: adding support for a "raw output" in JSON serializer)

2019-08-14 Thread Wes Turner
On Wednesday, August 14, 2019, Wes Turner wrote: > There's JSON5; which supports comments, trailing commas, IEEE 754 > ±Infinity and NaN, [...] > https://json5.org/ > > There's also JSON-LD, which supports xsd:datetime, everything that can be > expressed as RDF, @con

[Python-ideas] Re: JSON encoder protocol (was Re: adding support for a "raw output" in JSON serializer)

2019-08-14 Thread Wes Turner
14, 2019, at 19:48, Wes Turner wrote: > > > > Native serialization and deserialization support for either or both > JSON5, JSON lines, and JSON-LD would be great to have. > > PyPI has packages for all of these things (plus the two > not-quite-identical variations on JSONlines

[Python-ideas] Re: JSON encoder protocol (was Re: adding support for a "raw output" in JSON serializer)

2019-08-15 Thread Wes Turner
On Thursday, August 15, 2019, Andrew Barnert wrote: > On Aug 14, 2019, at 20:35, Wes Turner wrote: > > > A few questions then are: > > > > Should __json__() be versioned? > > Why? While there are sort of multiple versions of JSON (pre-spec, ECMA404, > and th

[Python-ideas] Re: JSON encoder protocol (was Re: adding support for a "raw output" in JSON serializer)

2019-08-15 Thread Wes Turner
On Thursday, August 15, 2019, Andrew Barnert wrote: > On Aug 15, 2019, at 10:23, Christopher Barker wrote: > > > > This is all making me think it's time for a broader discussion / PEP: > > > > The future of the JSON module. > > I think this is overreacting. There’s really only two issues here, a

[Python-ideas] Re: [Distutils] Linux binary wheels?

2019-08-19 Thread Wes Turner
How does this proposal differ from manylinux2010? https://github.com/pypa/manylinux/blob/master/README.rst#example PEP 513: manylinux1 https://www.python.org/dev/peps/pep-0513/ PEP 571: The manylinux2010 Platform Tag (latest, as of 2019) https://www.python.org/dev/peps/pep-0571/ On Monday, Au

[Python-ideas] Re: [Distutils] Linux binary wheels?

2019-08-20 Thread Wes Turner
FWIW, conda supports the e.g. armv7l aarch32 and armv8 aarch64 / "ARM64" platforms. Third-party-built packages are the norm there; where there are channels like conda-forge and rpi. What does it mean to sign a CI build from a given unsigned git tag? "Build conda packages for ARM" https://github.co

[Python-ideas] Re: Idea/PEP draft: Add support of __main__.py to argparse.ArgumentParser.prog

2019-08-24 Thread Wes Turner
# Python packaging, setup.py, console_scripts entrypoints, and __main__.py ```python !ls ** ``` examplenb.ipynb requirements.txt setup.py example: __init__.py __main__.py thecode.py ```python !cat setup.py ``` from setuptools import setup setup(name='example',

[Python-ideas] Re: Idea/PEP draft: Add support of __main__.py to argparse.ArgumentParser.prog

2019-08-24 Thread Wes Turner
https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html#the-console-scripts-entry-point On Sat, Aug 24, 2019 at 5:11 PM Wes Turner wrote: > > # Python packaging, setup.py, console_scripts entrypoints, and __main__.py > > > ```python > !ls ** > ``` &g

[Python-ideas] Re: Idea/PEP draft: Add support of __main__.py to argparse.ArgumentParser.prog

2019-08-24 Thread Wes Turner
ntry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('example', 'console_scripts', 'example')() ) On Sat, Aug 24, 2

[Python-ideas] Re: Idea/PEP draft: Add support of __main__.py to argparse.ArgumentParser.prog

2019-08-24 Thread Wes Turner
NP! Sometimes it's just easier to explain with code On Sat, Aug 24, 2019 at 5:30 PM Michael Hooreman wrote: > > Tanks a lot Wes, > > I know what I will do on Monday :-) > > Le sam. 24 août 2019 23:22, Wes Turner a écrit : >> >> ```python >> !cat ../../

[Python-ideas] Re: Idea/PEP draft: Add support of __main__.py to argparse.ArgumentParser.prog

2019-08-24 Thread Wes Turner
=examplenb.ipynb On Sat, Aug 24, 2019 at 5:22 PM Wes Turner wrote: > > ```python > !cat ../../bin/example > ``` > > #!/home/user/-wrk/-ve37/s_example/bin/python3 > # EASY-INSTALL-ENTRY-SCRIPT: 'example','console_scripts','example' > __r

[Python-ideas] Re: Idea/PEP draft: Add support of __main__.py to argparse.ArgumentParser.prog

2019-08-24 Thread Wes Turner
So, to rephrase your request, you want argparse.ArgumentParser.prog to contain "{sys.executable} -m {modulename}" so that the help text correctly indicates that it was invoked that way? PEP notes: - POSIX only is maybe not a good strategy - Can cmdline contain other unescaped \0's? - This would b

[Python-ideas] Re: Adding fixed-point decimals as an option to replace floating-point

2019-11-14 Thread Wes Turner
FWIW, bigfloat (GNU MPFR) has arbitrary precision and rounding that can be set with `with` context managers: https://pythonhosted.org/bigfloat/ On Thursday, November 14, 2019, Greg Ewing wrote: > On 15/11/19 7:39 am, Chris Angelico wrote: >> >> But in your >> source code, if you type 4.1, you are

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Wes Turner
An IDE with support for PEP 484 / mypy / type annotations (and/or writing tests) can help minimize typing-related errors. https://github.com/python/typeshed/blob/master/stdlib/3/json/__init__.pyi https://github.com/python/mypy/blob/master/README.md#ide-linter-integrations-and-pre-commit On Wedne

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Wes Turner
Side q: Is there yet a way to get ? and/or ?? In IPython/Jupyter to list {typeshed,} annotations? On Thursday, November 28, 2019, Wes Turner wrote: > An IDE with support for PEP 484 / mypy / type annotations (and/or writing tests) can help minimize typing-related errors. > > https://g

[Python-ideas] Re: Calendar.year()

2019-11-28 Thread Wes Turner
IDK that a DeprecationWarning would be helpful or necessary? https://github.com/python/cpython/blob/02519f75d15b063914a11351da30178ca4ceb54b/Lib/calendar.py#L625 : ```python monthcalendar = c.monthdayscalendar prweek = c.prweek week = c.formatweek weekheader = c.formatweekheader prmonth = c.prmon

[Python-ideas] Renaming json.load()

2019-11-28 Thread Wes Turner
Maybe methods for learning to search the code and docs (rather than memorizing APIs) would be a worthwhile exercise? # Python import json help(json) # IPython !pydoc json import json json? json?? # RTD: Read The Docs (and/or update the docs) https://docs.python.org/3/search.html?q=loads https:

[Python-ideas] Re: Renaming json.load()

2019-11-30 Thread Wes Turner
I'd like to propose potentially adding my comments about strategies for learning APIs and typing through type annotations and introspection tooling with a potential PR to PICT-001. If there's interest, I'll consider preparing a PR? On Saturday, November 30, 2019, Paul Moore wrote: > On Sat, 30 N

[Python-ideas] Re: Renaming json.load()

2019-11-30 Thread Wes Turner
Though, PICT-001 should probably be reserved as an index for other PICT documents. On Saturday, November 30, 2019, Paul Moore wrote: > On Sat, 30 Nov 2019 at 10:57, Brian Skinn wrote: >> >> Why, we could even number them, call them Python-Issues Common Threads, abbreviate that as "PICT", and the

[Python-ideas] Re: namedtuple for dict.items()/collections.abc.Mappings.items()

2019-11-30 Thread Wes Turner
What about keys that contain invalid characters for attribute names? items = {'1': 1, 'two-3': 4,} x = object() x.__dict__.update(items) # dangerous x = AttrDict(**items) x.1 # error x.two-3 # error On Saturday, November 30, 2019, Eric V. Smith wrote: > On 11/30/2019 8:51 PM, Andrew Barnert

[Python-ideas] Re: namedtuple for dict.items()/collections.abc.Mappings.items()

2019-12-01 Thread Wes Turner
each) >>> for item in items_tuple(data): item.key, item.value 5.82 ms ± 117 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) On Sun, Dec 1, 2019 at 1:24 AM Andrew Barnert wrote: > > On Nov 30, 2019, at 20:21, Wes Turner wrote: > > > > What about keys that contai

[Python-ideas] Re: namedtuple for dict.items()/collections.abc.Mappings.items()

2019-12-01 Thread Wes Turner
Optimizations to namedtuple would likely be welcomed. __slots__ is the optimization for objects that don't need dicts. Ordered by performance: tuple, namedtuple, object, dataclass. A more raw struct would be faster: https://docs.python.org/3/c-api/tuple.html#struct-sequence-objects cProfile/profi

[Python-ideas] Re: Archiving Threads / Closing Threads

2019-12-03 Thread Wes Turner
https://discuss.python.org is an instance of Discourse, which, like mailman, is also open source. https://github.com/discourse/discourse https://meta.discourse.org/t/discourse-moderation-guide/63116 https://gitlab.com/mailman/mailman I agree that Broken thread reply chains would be the likely o

[Python-ideas] Re: Argumenting in favor of first()

2019-12-07 Thread Wes Turner
+1 for itertools.first(seq, default=Exception) *and* itertools.one(seq, default=Exception) This is a very common pattern (particularly with RDF / JSON-LD (@type) where there can be multiple instances of any predicate-object / attribute-value pair) SQLAlchemy also has .first(), .one(), and .one_or

[Python-ideas] Re: Argumenting in favor of first()

2019-12-07 Thread Wes Turner
On Sat, Dec 7, 2019, 8:20 PM Andrew Barnert wrote: > On Dec 7, 2019, at 07:33, Wes Turner wrote: > > > >  > > +1 for itertools.first(seq, default=Exception) *and* itertools.one(seq, > default=Exception) > > What does default=Exception mean? What happens if you pas

[Python-ideas] Re: Argumenting in favor of first()

2019-12-09 Thread Wes Turner
On Sat, Dec 7, 2019, 11:30 PM Andrew Barnert wrote: > On Dec 7, 2019, at 18:09, Wes Turner wrote: > > > On Sat, Dec 7, 2019, 8:20 PM Andrew Barnert wrote: > >> On Dec 7, 2019, at 07:33, Wes Turner wrote: >> > >> >  >> > +1 for itertools.first

[Python-ideas] Re: Argumenting in favor of first()

2019-12-09 Thread Wes Turner
def next(iterable[, default]): """ Returns: Return the next item from the iterator. Raises: StopIteration: when iterator is empty and default is not specified """ def first(iterable, default=None): """ Returns: default (which defaults to None) if the

[Python-ideas] Re: Argumenting in favor of first()

2019-12-09 Thread Wes Turner
On Tue, Dec 10, 2019 at 1:37 AM Andrew Barnert wrote: > > On Dec 9, 2019, at 22:07, Wes Turner wrote: > > > > > > Sets are not collections.abc.Sequence because they do not implement > > __getitem__. > > Are there other unordered Iterables in the standard l

[Python-ideas] Re: Argumenting in favor of first()

2019-12-13 Thread Wes Turner
Would the builtins import look like this: if not hasattr(__builtins__, 'first'): from more_itertools.more import first Or this: import sys if sys.version_info[:2] < (3,9): from more_itertools.more import first Having the same argspec as more_itertools.more.first would get us a free back

[Python-ideas] Re: Allow using the or operator to denote unions in type annotations

2020-03-13 Thread Wes Turner
Support for "| None" would be great to have. +1. https://github.com/python/peps/blob/master/pep-0604.rst On Fri, Mar 13, 2020, 9:36 AM Chris Angelico wrote: > On Sat, Mar 14, 2020 at 12:24 AM Noah Peter May wrote: > > > > Hello everyone, > > > > I'm not certain if this has been brought up be

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-15 Thread Wes Turner
- CPython has __str__ and __repr__, IPython has obj._repr_fmt_(), MarkupSafe has obj.__html__(), https://github.com/tommikaikkonen/prettyprinter has @register_pretty Neither __str__ nor __repr__ have any round-trip guarantee/expectation (they're not suitable for serialization/deserialization // ma

[Python-ideas] Re: SQL string prefix idea

2020-03-15 Thread Wes Turner
There are many variants of SQL. DB-API only solves for so much. >From "[Python-ideas] Draft PEP on string interpolation" (=> f-strings) https://groups.google.com/d/msg/python-ideas/6tfm3e2UtDU/8ugqbZtYAwAJ : ```quote IIUC, to do this with SQL, > sql(i'select {date:as_date} from {tablename}' ne

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-15 Thread Wes Turner
On Mon, Mar 16, 2020, 1:04 AM Greg Ewing wrote: > On 16/03/20 2:27 pm, Christopher Barker wrote: > > I imagine a LOT of code out there (doctests, who know > > what else) does in fact expect the str() of builtins not to change -- so > > this is probably dead in the water. > > Also, strs and reprs

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-16 Thread Wes Turner
On Mon, Mar 16, 2020, 3:41 AM Andrew Barnert via Python-ideas < python-ideas@python.org> wrote: > On Mar 15, 2020, at 22:37, Stephen J. Turnbull < > turnbull.stephen...@u.tsukuba.ac.jp> wrote: > > > > > > Because they're not always available, even in 2020. Also, ∞ is > > ambiguous; it's used for

[Python-ideas] Re: pretty-printing in the terminal

2020-03-31 Thread Wes Turner
"[Python-ideas] dunder methods for encoding & prettiness aware formal & informal representations" https://mail.python.org/archives/list/python-ideas@python.org/thread/OQPPJ7SNM5CZUI5RYT5R4Z6YZWMNNTZS/ discusses how pretty printing could be extended. I'll bump the thread On Tue, Mar 31, 2020, 5:54

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-31 Thread Wes Turner
Bump to CC Re: "[Python-ideas] pretty-printing in the terminal" On Sun, Mar 22, 2020, 8:53 PM Kyle Stanley wrote: > I ended up opening an issue for it at https://bugs.python.org/issue40045. > > > On Sun, Mar 22, 2020 at 8:33 PM Kyle Stanley wrote: > >> Chistopher Barker

[Python-ideas] Re: Changing Package Representation On Shell

2020-04-02 Thread Wes Turner
This prints modname.__doc__ / help(modname) / inspect.getdoc(modname) with IPython / Jupyter + ipykernel: >>> modname? This prints something like inspect.getsource(modname) >>> modname?? https://ipython.readthedocs.io/en/stable/interactive/python-ipython-diff.html#accessing-help https://docs.p

[Python-ideas] Re: python interpreter docker builder

2020-04-02 Thread Wes Turner
https://devguide.python.org/buildbots/ These run in Docker containers: - https://github.com/python/cpython/blob/master/.travis.yml - https://github.com/conda-forge/python-feedstock/blob/master/recipe/build.sh These are all of the current builds; are you proposing another? https://github.com/pytho

[Python-ideas] Re: Changing Package Representation On Shell

2020-04-02 Thread Wes Turner
IDK what you'd grep for in these; if it's not there you could send a PR that adds more greppable keywords or cross-:ref:'s the sys.displayhook docs like this: :func:`sys.displayhook` https://docs.python.org/3/library/sys.html#sys.displayhook https://github.com/python/cpython/blob/master/Doc/librar

[Python-ideas] Re: python interpreter docker builder

2020-04-02 Thread Wes Turner
ave a python tarball similar to the "Windows x86 > embeddable zip file" but for linux. > Similar to miniconda but for plain python, or sort of python "sdk", if > that makes sense. > > Thanks > > PS. I didn't know about the core workflow, thanks > > >

[Python-ideas] Re: python interpreter docker builder

2020-04-02 Thread Wes Turner
;t be what I have > in mind. > > The point would be providing a python sdk, similar to what node/java/.net > provide. something it would possible to build upon. > Those are distributed as stand alone "zip" to the general public. > > > > On Thu, 2 Apr 2020 at 20

  1   2   3   4   >