Re: PyCon
Two interesting ones: - Norwegian library: https://fosstodon.org/@osdotsystem/112459312723574625 - One about if Ai will take our jobs, using py to find out and she concludes it will On Sat, 18 May 2024, 14:15 Chris Angelico via Python-list, < python-list@python.org> wrote: > On Sun, 19 May 2024 at 04:10, Abdur-Rahmaan Janhangeer via Python-list > wrote: > > > > Yes, this year's pretty exciting, great keynotes, great lightnings, great > > location, great even sponsor talks (thought they would be pumping a lot > of > > marketing, but the ones i went were pretty awesome technically) > > > > Organization side pretty smooth as well > > I missed out on the first day's lightning talks session due to > conflict with work, and it didn't seem to have been recorded. What did > I miss? > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: PyCon
Yes, this year's pretty exciting, great keynotes, great lightnings, great location, great even sponsor talks (thought they would be pumping a lot of marketing, but the ones i went were pretty awesome technically) Organization side pretty smooth as well On Fri, 17 May 2024, 20:58 Larry Martell via Python-list, < python-list@python.org> wrote: > I’m at PyCon in Pittsburgh and I’m haven’t an amazing time! > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: [RELEASE] Python 3.12.3 and 3.13.0a6 released
I have to comment on this one: "Docstrings now have their leading indentation stripped" Incredibly useful! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Tue, Apr 9, 2024 at 11:18 PM Thomas Wouters via Python-list < python-list@python.org> wrote: > *It’s time to eclipse the Python 3.11.9 release with two releases*, one of > which is the *very last alpha release of Python 3.13*: > < > https://discuss.python.org/t/python-3-12-3-and-3-13-0a6-released/50601#python-3123-1 > >Python > 3.12.3 > > 300+ of the finest commits went into this latest maintenance release of the > latest Python version, the most stablest, securest, bugfreeest we could > make it. > https://www.python.org/downloads/release/python-3123/ > < > https://discuss.python.org/t/python-3-12-3-and-3-13-0a6-released/50601#python-3130a6-2 > >Python > 3.13.0a6 > > What’s that? The last alpha release? Just one more month until feature > freeze! Get your features done, get your bugs fixed, let’s get 3.13.0 ready > for people to actually use! Until then, let’s test with alpha 6. The > highlights of 3.13 you ask? Well: > >- In the interactive interpreter, exception tracebacks are now colorized >by default ><https://docs.python.org/dev/whatsnew/3.13.html#improved-error-messages > >. >- A preliminary, *experimental* JIT was added >< > https://docs.python.org/dev/whatsnew/3.13.html#experimental-jit-compiler>, >providing the ground work for significant performance improvements. >- The (cyclic) garbage collector is now incremental >< > https://docs.python.org/dev/whatsnew/3.13.html#incremental-garbage-collection > >, >which should mean shorter pauses for collection in programs with a lot > of >objects. >- Docstrings now have their leading indentation stripped ><https://docs.python.org/dev/whatsnew/3.13.html#other-language-changes > >, >reducing memory use and the size of .pyc files. (Most tools handling >docstrings already strip leading indentation.) >- The dbm module <https://docs.python.org/dev/library/dbm.html> has a >new dbm.sqlite3 backend ><https://docs.python.org/dev/whatsnew/3.13.html#id1> that is used by >default when creating new files. >- PEP 594 (Removing dead batteries from the standard library) ><https://peps.python.org/pep-0594/> scheduled removals of many >deprecated modules: aifc, audioop, chunk, cgi, cgitb, crypt, imghdr, >mailcap, msilib, nis, nntplib, ossaudiodev, pipes, sndhdr, spwd, sunau, >telnetlib, uu, xdrlib, lib2to3. >- Many other removals ><https://docs.python.org/dev/whatsnew/3.13.html#removed> of deprecated >classes, functions and methods in various standard library modules. >- New deprecations ><https://docs.python.org/dev/whatsnew/3.13.html#deprecated>, most of >which are scheduled for removal from Python 3.15 or 3.16. >- C API removals <https://docs.python.org/dev/whatsnew/3.13.html#id10> >and deprecations <https://docs.python.org/dev/whatsnew/3.13.html#id9>. >(Some removals present in alpha 1 were reverted in alpha 2, as the > removals >were deemed too disruptive at this time.) > > (Hey, *fellow core developer,* if a feature you find important is missing > from this list, let Thomas know . It’s getting to be > really important now!) > https://www.python.org/downloads/release/python-3130a6/ > < > https://discuss.python.org/t/python-3-12-3-and-3-13-0a6-released/50601#we-hope-you-enjoy-the-new-releases-3 > >We > hope you enjoy the new releases! > > Thanks to all of the many volunteers who help make Python Development and > these releases possible! Please consider supporting our efforts by > volunteering yourself, or through contributions to the Python Software > Foundation <https://www.python.org/psf-landing/> or CPython itself > <https://github.com/sponsors/python>. > > Thomas “can you tell I haven’t had coffee today” Wouters > on behalf of your release team, > > Ned Deily > Steve Dower > Pablo Galindo Salgado > Łukasz Langa > -- > Thomas Wouters > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: on the python paradox
I choose Python and still stick with it as default as I choose Python because of its design beauty. Typing does not mean mandatory braces. There can be an indentation-based language that is strongly typed. Python is beautiful in itself. Beautiful to look at. Source code should be easy for the average human to relate to and connect with easily. Being more alien-ware-like does not magically increase performance. Our taste and quality bar should be high after so much time has passed. I don't see a language as beautiful as it is front-end wise. "And people don't learn Python because it will get them a job; they learn it because they genuinely like to program and aren't satisfied with the languages they already know." Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Why no list as dict key?
As clear as daylight, thanks! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Why no list as dict key?
Assumes checking for object equality before inserting. If they are they same, do we need different hashes? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Thu, Apr 21, 2022 at 7:15 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2022-04-21 at 06:22:53 +0400, > Abdur-Rahmaan Janhangeer wrote: > > > Maybe hashes should point to an object rather than being the hash of an > > object themselves. > > Maybe the speed drop is not worth it. > > Then you have a different problem. > > x = [1, 2, 3] > y = [n for n in 1, 2, 3] > > Those two lists (x and y) are separate but equal objects. Being > separate, pointers to them would not be equal. Being equal, they have > to have the same hash. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Why no list as dict key?
Thanks everybody, In the the event spam is appended a value, then looking for [1,2] does not return anything but looking for [1,2,3] yes. But i gather the way dictionaries are implemented makes it difficult to do so ... Maybe hashes should point to an object rather than being the hash of an object themselves. Maybe the speed drop is not worth it. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Wed, Apr 20, 2022 at 10:35 PM Chris Angelico wrote: > On Thu, 21 Apr 2022 at 04:23, Abdur-Rahmaan Janhangeer > wrote: > > > > Greetings list, > > Greetings tuple, > > > Using Python3.9, i cannot assign a list [1, 2] as key > > to a dictionary. Why is that so? Thanks in advanced! > > > > Because a list can be changed, which would change what it's equal to: > > >>> spam = [1, 2] > >>> ham = [1, 2, 3] > >>> spam == ham > False > >>> spam.append(3) > >>> spam == ham > True > > If you use spam as a dict key, then mutate it in any way, it would > break dict invariants of all kinds (eg you could also have used ham as > a key, and then you'd have duplicate keys). > > Instead, use a tuple, which can't be mutated, is always equal to the > same things, and is hashable, which means it can be used as a key: > > >>> spam = (1, 2) > >>> ham = (1, 2, 3) > >>> {spam: "spam", ham: "ham"} > {(1, 2): 'spam', (1, 2, 3): 'ham'} > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Why no list as dict key?
Greetings list, Using Python3.9, i cannot assign a list [1, 2] as key to a dictionary. Why is that so? Thanks in advanced! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Qualification?
I'd say that you need: programming fundamentals common tools Python expertise As for Python expertise, you are expected to know Python fundamentals, a fair amount of the standard library, a nice level of popular fields (data science, web scraping, networking, async, etc) To specialize in one. I'd say that contributing to OpenSource helps a lot to sharpen the sense of knowing what you need exactly! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Tue, Mar 29, 2022 at 11:34 PM alister via Python-list < python-list@python.org> wrote: > I'm currently considering a career change (not much choice actually just > been made redundant). > I'd like to be able to turn my interest in python to my advantage, What > qualifications do employers look for? > > > > -- > I'm reporting for duty as a modern person. I want to do the Latin Hustle > now! > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
> I never knew this. Where can I read more about this origin? https://python-history.blogspot.com/2009/01/personal-history-part-1-cwi.html?m=1 <> There are more sources which i cannot remember from the top of my head -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
Yes i know that JS has switch from before I was referring to the pattern matching proposal. I cannot find the original place i read it from but here's the github one https://github.com/tc39/proposal-pattern-matching -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
Normally people put Python in the scripting category. I learnt typed languages like C++ and Java at first. People who learn languages like these tend to put Python in a non-serious category. The post was more ironic than litteral. After 5 years of following the mailing lists i realised that there is more than the eyes meet. My hobby has always been language engineering / compiler theory and just recently i realised that Python is pretty serious about language features. I have been following language feature proposals from various languages. Some decide to avoid Python's route, but others have been trying hard to catch up with Python. One gleaming example is the switch case. JS recently proposed pattern matching, referencing Python and explaining why the proposal is a cool treatment of the usecase. As a side note, if by scripting we mean OS commands, then Python started as a sysadmin language. -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
Avi solved the captive portal problem above. It's by comparing the page content to a dynamic output. I was asking for wifi just in case i missed anything we did not yet discuss. I consider the thread closed, thanks everybody, it was very fruitful for me. Thanks for the in-between. I really like the Python comunity as, even though it's a 'scripting' language, the scrutiny of issues and general discussions are currenly up to a very nice level. See you on another thread soon! -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
> > > Since you have to deal with things that you do not control changing > after you check what is the point in checking? You have to write the code > to recover anyway. > Well foe my usecase, the operation running is not in months or a really long time. As Avi mentionned above, that would be pointless. The upcoming operation is short enough and though we cannot assume that it will be the case when we are running the operation, we sensibly assume it will still be the case. This is more an extra check to not start an operation than either relying to check at the start or when query. It's both. > -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
I've got my answers but the 'wandering' a bit on this thread is at least connected to the topic ^^. Last question: If we check for wifi or ethernet cable connection? Wifi sometimes tell of connected but no internet connection. So it detected that there is or there is no internet ... -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
Well, nice perspective. It's a valid consideration, sound theory but poor practicality according to me. It you view it like this then between the moment we press run or enter key on the terminal, our Python interpreter might get deleted. We never know, it can happen. Though it's nice to go in and catch exceptions, if you have a long operation upcoming it might be nice to see if your key element is present. Much like checking if goal posts are present before starting a football game. You can of course start the match, pass the ball around and when shooting you stop the match as you realise that the goal posts are not around. Checking by exceptions is what the snippet i shared does. But we check for the ability to do it before we start. Of course, it can change in the seconds that follow. But it's too much pure logic at work. -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
Thanks for the function but i think having the function as described won't return True all time Me: dipping my foot in hot water, yes we can go ... In the sprit of "practicality beats purity", devs needs a function XD Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
A front end eng sent me this for how to check for the internet in JS https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-online But it also says: "This attribute is inherently unreliable. A computer can be connected to a network without having Internet access." As discussed here but, it would have been nevertheless great to have this tiny function instead of nothing Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Mon, Feb 7, 2022 at 1:17 PM Abdur-Rahmaan Janhangeer < arj.pyt...@gmail.com> wrote: > Greetings, > > Using the standard library or 3rd party libraries, what's the > best way to check if there is internet? Checking if google.com > is reachable is good but I wonder if there is a more native, > protocol-oriented > way of knowing? > > Even this URL recommends checking if a domain is up as a way to check for > internet connectivity: > > https://www.ibm.com/support/pages/checking-network-connectivity-when-using-python-and-ibm-resilient-circuits > > Kind Regards, > > Abdur-Rahmaan Janhangeer > about <https://compileralchemy.github.io/> | blog > <https://www.pythonkitchen.com> > github <https://github.com/Abdur-RahmaanJ> > Mauritius > -- https://mail.python.org/mailman/listinfo/python-list
Re: Why does not Python accept functions with no names?
> BTW, this is not what is usually meant by the term "anonymous function". An anonymous function is one that is not bound to *any* name. The thing you're proposing wouldn't be anonymous -- it would have a name, that name being the empty string. Thanks for clarifying this point -- https://mail.python.org/mailman/listinfo/python-list
Re: Why does not Python accept functions with no names?
Yes I know about lambdas but was just an introspection about the reasoning behind ^^ Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Why does not Python accept functions with no names?
Thanks for the answers. @Chris Well Python deliberately throws an exception if we do not pass in a function name. Just wanted to know why it should. As the above case is a 100% pure anonymous function. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Why does not Python accept functions with no names?
Greetings list. Out of curiosity, why doesn't Python accept def (): return '---' () Where the function name is ''? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
> This won't work if you're behind a captive portal: every URL you try to get will return successfully, but the content will be the captive portal page. Yes agree a pretty common scenario if you are moving around ... The solution is to test against a webpage you know the content will always be the same. Thanks for pointing out! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
> Ah, but WHEN do those browsers report that? When attempting to connect to whatever the default "home" page has been set to? (Mine is configured to use https://www.google.com as the default page -- if my router is down, obviously the browser will time-out waiting for a response from Google, and report "no network"). Yes you are right ... lol i misread the error i guess Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
It's a demo to get the idea behind, uses requests and the rich library. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Wed, Feb 9, 2022 at 12:24 PM Gisle Vanem wrote: > Abdur-Rahmaan Janhangeer wrote: > > > Thanks everybody for the answers. It was very enlightening. Here's my > > solution: > > > > # using rich console > > def ensure_internet(): > > console = Console() > > domains = [ > > 'https://google.com', > > 'https://yahoo.com', > > 'https://bing.com', > > 'https://www.ecosia.org', > > 'https://www.wikipedia.org' > > ] > > results = [] > > with console.status("Checking internet ...", spinner="dots"): > > for domain in domains: > > try: > > requests.get(domain) > > results.append(1) > > except Exception as e: > > results.append(0) > > if not any(results): > > print('No internet connection') > > sys.exit() > > Was this supposed to be a self-contained working > program? It doesn't work here. > > Were/what is 'Console()' for example? > > -- > --gv > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
Thanks everybody for the answers. It was very enlightening. Here's my solution: # using rich console def ensure_internet(): console = Console() domains = [ 'https://google.com', 'https://yahoo.com', 'https://bing.com', 'https://www.ecosia.org', 'https://www.wikipedia.org' ] results = [] with console.status("Checking internet ...", spinner="dots"): for domain in domains: try: requests.get(domain) results.append(1) except Exception as e: results.append(0) if not any(results): print('No internet connection') sys.exit() gist link: https://gist.github.com/Abdur-rahmaanJ/7917dc5ab7f5d2aa37b2723909be08f7 I think for me having the internet means ability to request urls Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Best way to check if there is internet?
Popular browsers tell: No internet connection detected. A function that goes in the same sense. Unless they too are pinging Google.com to check ... Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Mon, Feb 7, 2022 at 1:28 PM Chris Angelico wrote: > On Mon, 7 Feb 2022 at 20:18, Abdur-Rahmaan Janhangeer > wrote: > > > > Greetings, > > > > Using the standard library or 3rd party libraries, what's the > > best way to check if there is internet? Checking if google.com > > is reachable is good but I wonder if there is a more native, > > protocol-oriented > > way of knowing? > > > > What do you mean by "if there is internet"? How low a level of > connection do you want to test? You could ping an IP address that you > know and can guarantee will respond. You could attempt a DNS lookup. > You could try an HTTP request. Each one can fail in different ways, > for different reasons. It's best to test what you actually care about. > > > Even this URL recommends checking if a domain is up as a way to check for > > internet connectivity: > > > https://www.ibm.com/support/pages/checking-network-connectivity-when-using-python-and-ibm-resilient-circuits > > That talks about a misconfigured proxy as being the most likely cause. > Is that something you're trying to test for? > > There is no single concept of "there is internet". (Other than, in a > trivial sense, that the internet does exist.) What you need to know is > "can I use the internet?", and ultimately, that depends on what you > need it to do. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Best way to check if there is internet?
Greetings, Using the standard library or 3rd party libraries, what's the best way to check if there is internet? Checking if google.com is reachable is good but I wonder if there is a more native, protocol-oriented way of knowing? Even this URL recommends checking if a domain is up as a way to check for internet connectivity: https://www.ibm.com/support/pages/checking-network-connectivity-when-using-python-and-ibm-resilient-circuits Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: A Newspaper for Python Mailing Lists
On the news side i was wrong as newsletters have been covering it since long on a monthly basis, but not as in depth as it should be but awesome job though. Else i have been going through early archives but the quality of postings are not very great. The mailing lists have made awesome progress over the years! Now the topics are very serious, the conversations contribute much. Keep it up! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: A Newspaper for Python Mailing Lists
Well, this one is a newspaper as opposed to being a newsletter. Newsletters are a collection of links. See AwesomePython PythonWeekly PyCoders Weekly Newspapers also contain articles, the above don't. As some mails pointed out above, this is like the lwn of Python I have been avoiding the topics and formats used by existing newsletters by focusing on news among others. But its funny to see one of them starting to cover news by writing an external article on a website they own then link it in the newsletter. It's what you call competition i guess XD The focus of this one is and remains mailing lists / discuss platforms. A look at the archives and you can see publishing interesting mails. Something you don't have with newsletters. The main aim of it is getting myself updated with discussions and pep status and sharing it with the world. Something i feel i was not getting with existing resources. I had cool tutos/articles, new libs, popular posts, job openings, events but not a complete overview of meta posts. On Fri, 21 Jan 2022, 02:13 Dan Stromberg, wrote: > > There's also Python Weekly: > https://www.pythonweekly.com/ > > On Sat, Jan 8, 2022 at 10:29 PM Abdur-Rahmaan Janhangeer < > arj.pyt...@gmail.com> wrote: > >> Well yes XD though LWN covers Py topics well when it wants >> >> >> 1. Yes sure, did not expect RSS interest >> 2. Excuse my blunder, will do! >> >> > >> -- >> https://mail.python.org/mailman/listinfo/python-list >> > -- https://mail.python.org/mailman/listinfo/python-list
Re: A Newspaper for Python Mailing Lists
Now I have a concern. For the RSS feed. Does your client filter by the latest item or pubDate? I published another edition yesterday but noticed that the item was not the latest in the list. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Sun, Dec 26, 2021 at 8:40 PM Abdur-Rahmaan Janhangeer < arj.pyt...@gmail.com> wrote: > Greetings lists, > > I have started a newspaper (not newsletter) focused > on interesting reads on Python mailing lists. Don't tag > on the fact that holiday seasons are the worst times for > launch according to marketing folks, I started this to note > down interesting mails. This might also be a great way to > bring mailing list gems to a wider readership. So, here's > the url https://pyherald.com/ > > Kind Regards, > > Abdur-Rahmaan Janhangeer > about <https://compileralchemy.github.io/> | blog > <https://www.pythonkitchen.com> > github <https://github.com/Abdur-RahmaanJ> > Mauritius > -- https://mail.python.org/mailman/listinfo/python-list
Re: A Newspaper for Python Mailing Lists
Added RSS: 2.0 unless later versions have some advantages: https://pyherald.com/rss.xml Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius > -- https://mail.python.org/mailman/listinfo/python-list
Re: A Newspaper for Python Mailing Lists
Well yes XD though LWN covers Py topics well when it wants 1. Yes sure, did not expect RSS interest 2. Excuse my blunder, will do! On Sun, 9 Jan 2022, 01:15 Peter J. Holzer, wrote: > On 2021-12-26 20:40:03 +0400, Abdur-Rahmaan Janhangeer wrote: > > I have started a newspaper (not newsletter) focused > > on interesting reads on Python mailing lists. Don't tag > > on the fact that holiday seasons are the worst times for > > launch according to marketing folks, I started this to note > > down interesting mails. This might also be a great way to > > bring mailing list gems to a wider readership. So, here's > > the url https://pyherald.com/ > > Something like [LWN](https://lwn.net/) for Python? Neat. > > Two suggestions: > > 1. Could you add an RSS or Atom feed? > > 2. CSS «word-break: break-all» seems like a really weird choice for >English language text. If you really want to break words across >lines, use «hyphens: auto». > > hp > > -- >_ | Peter J. Holzer| Story must make more sense than reality. > |_|_) || > | | | h...@hjp.at |-- Charles Stross, "Creative writing > __/ | http://www.hjp.at/ | challenge!" > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
A Newspaper for Python Mailing Lists
Greetings lists, I have started a newspaper (not newsletter) focused on interesting reads on Python mailing lists. Don't tag on the fact that holiday seasons are the worst times for launch according to marketing folks, I started this to note down interesting mails. This might also be a great way to bring mailing list gems to a wider readership. So, here's the url https://pyherald.com/ Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: PyCharm settings - per: print('\N{flag: Mauritius}') not supported in py3.9
Yet another unicode issue XD Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: print('\N{flag: Mauritius}') not supported in py3.9
Greetings, But why is it so? -- https://mail.python.org/mailman/listinfo/python-list
Re: print('\N{flag: Mauritius}') not supported in py3.9
Greetings, I get you but why do the short names work for some and not for others? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
print('\N{flag: Mauritius}') not supported in py3.9
Mike Driscoll printed this on Twitter >>> print('\N{Sauropod}') 秊 Using py3.9 i got the above. I found the whole CLDR short name here: https://unicode.org/emoji/charts/full-emoji-list.html However when i do >>> print('\N{flag: Mauritius}') File "", line 1 print('\N{flag: Mauritius}') ^ i get SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-18: unknown Unicode character name So is it that Python3.9 does not support it or what is the issue here? Thanks Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Advantages of Default Factory in Dataclasses
On Tue, Nov 16, 2021 at 7:17 PM Paul Bryan wrote: > On Tue, 2021-11-16 at 17:04 +0400, Abdur-Rahmaan Janhangeer wrote: > > A simple question: why do we need field(default_factory ) in dataclasses? > > > To initialize a default value when a new instance of the dataclass is > created. For example, if you want a field to default to a dict. A new dict > is created for each instance of the dataclass created. > Why not have an attribute which returns a deep copy of a dict? Like the only advantage of default factory is copying whatever we specify? -- https://mail.python.org/mailman/listinfo/python-list
Advantages of Default Factory in Dataclasses
Greetings list, A simple question: why do we need field(default_factory ) in dataclasses? Why not make that field as an attribute return a function? Useful implementation examples / use cases appreciated. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Getting Directory of Command Line Entry Point For Packages
Greetings, This is what I am trying to do: How to get the getcwd of the directory of where the command is run and not that of the file where the cli entrypoint is found. Having the user enter the absolute path as a cli argument does not sound nice. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Getting Directory of Command Line Entry Point For Packages
Greetings, Well since sometimes i have this: https://github.com/shopyo/shopyo Old versions worked as we are using it for FlaskCon <https://github.com/flaskcon/traveller>, even newer versions until sometimes ago. shopyo has a copy of the project which is a flask app in site-packages. upon using shopyo new, it creates a copy of the project in the current folder then on running say shopyo run, it just passes commandline args flask run under the hood Only thing is that os.getcwd is giving the path of site-packages and not the directory from which the command is run from. See the run command's source here: https://github.com/shopyo/shopyo/blob/19dc2ee03ff0a6a0dca3237f80a11478ee2dbe46/shopyo/api/cmd_helper.py#L313 Same goes for other commands. I wanted to know how to get the directory from which the command is called from. Thanks Else i assume you are the author of this article <https://python-history.blogspot.com/2009/04/and-snake-attacks.html> as i was compiling a list of articles <https://www.pythonkitchen.com/python-engineering-articles/> and guess that it might be. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Getting Directory of Command Line Entry Point For Packages
Greetings list, Let's say i created a package named miaw miaw also has a cli command called miaw miaw prints files and folders in the directory it is called in except that when miaw is used, it prints the files and folders in site-packages This is an analogy for a package i have. Well forgetting about the lines above, how do i get the path from which miaw the command is called from? Thanks Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
[issue45744] Fix Flawfinder C Errors
New submission from Abdur-rahmaan Janhangeer : Greetings all, I was doing a security audit using https://dwheeler.com/flawfinder/ There are quite some issues. Before i PR, i am opening an issue as per the dev guide. Await further comments. Thanks! -- messages: 405910 nosy: appinv priority: normal severity: normal status: open title: Fix Flawfinder C Errors type: enhancement versions: Python 3.11 ___ Python tracker <https://bugs.python.org/issue45744> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
First Ever FlaskCon Tickets Sales
Greetings list, I count my events-related posts to the mailing list. But i'd like to make an exception for FlaskCon this year. As the first ever tickets sales is ongoing: https://ti.to/flaskcon/flaskcon-2021 Python fans, please forward / tweet the message. Any questions, ping me! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Why so fast a web framework?
Well, They don't choose languages per se but choose frameworks based on that and ... by virtue of that choose languages. Like just to get faster web services. The benchmark is pretty much referred to in the Python world, web side like https://www.starlette.io/ "Independent TechEmpower benchmarks show Starlette applications running under Uvicorn as one of the fastest Python frameworks available. (*)" https://github.com/tiangolo/fastapi ... (thanks to Starlette and Pydantic). One of the fastest Python frameworks available. Both with links to the benchmarks. So, while non-web folks don't care, web folks seem to care. And as a web someone i wanted to know why is that so. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Why so fast a web framework?
Me Like why exactly is that the case, i would not be surprised for rust, C, CPP etc But as to where the difference comes for two comparatively similar langs. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
FlaskCon 2021: The Last Call
Greetings everybody, FlaskCon's CFP closes soon. If you plan to push in some talks, please do so. Don't worry about reviewing and push it in, like it's very simple to get started with and this year might be the last online one. This year it's pre-recorded with optional live QnA. So internet connection should not be an issue. Submit talks: https://flaskcon.com/y/2021/ Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: walrus with a twist :+= or ...
The proposal is very interesting, my only concern is readability unless a team has a tool check and flag it out as a process. Else i fear one day i'll be seeing =+_+= in Python code. But jokes aside @Avi why would someone want to immediately add a 2 after walrus defining it? in :+=2 Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Why so fast a web framework?
@Chris @Peter See that famous benchmark https://www.techempower.com/benchmarks/#section=data-r20 Like routinely PHP frameworks appear higher up than py -- https://mail.python.org/mailman/listinfo/python-list
Why so fast a web framework?
See this: https://github.com/walkor/webman Why similar frameworks do not exist in Python. Is it because of lack of lib contributors or due to an inherent difference in Py and PHP? Thanks! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: New assignmens ...
I no longer track the threads on the subject ... Many simultaneous ones ongoing! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
[Python-announce] FlaskCon's CFP is now open till Oct 24
Greetings folks, FlaskCon is around again this year, the very latest conf of the year. Bouncing in the first week of December, 1 2 3 4. CFP is open, submit -> https://flaskcon.com/ Any queries, let them fly to flask...@gmail.com Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius ___ Python-announce-list mailing list -- python-announce-list@python.org To unsubscribe send an email to python-announce-list-le...@python.org https://mail.python.org/mailman3/lists/python-announce-list.python.org/ Member address: arch...@mail-archive.com
FlaskCon's CFP is now open till Oct 24
Greetings folks, FlaskCon is around again this year, the very latest conf of the year. Bouncing in the first week of December, 1 2 3 4. CFP is open, submit -> https://flaskcon.com/ Any queries, let them fly to flask...@gmail.com Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: EuroPython Society: General Assembly 2021
Greetings Damien, The mailing list is public and i would have a hard time dealing with 1000s of people replying: `stop mailing me`, maybe a private message to mal would have sufficed. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: The code version of python -i
Oh thanks a lot, i was way from list this week Just a note: it's pretty amazing to have at Chris Angelico at your local PUG Else, Well, let's say you have a lib that you need to provide users with a shell for them to try out functions, no need to translate functions to cli args. Like Django provides a shell for users to use. The aim of injection is to allow code usage without imports. The presentation write-up is pretty new to me as I never approached clean code presentations. My presentations have always been hard text on screen <https://youtu.be/pvwvRi6iMds>. As all coders my natural instinct is to ... code a prez tool from scratch! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Fri, Sep 17, 2021 at 5:04 AM dn via Python-list wrote: > Abdur-Rahmaan, > Apologies for delay: several last-minute tasks were landed on me, so I > haven't been able to 'read the list' since last week. > > > > If i have a file name flower.py and i add x = 1 in it. > > When i run python -i flower.py i get a shell > >>>> > > > > If type x i get 1 > >>>> x > > 1 > > > > The values are auto injected. > > > > How do i start a shell by code with values already injected? Thanks > > > What do you want to achieve with this? > > > At this week's local PUG meeting, I was 'the warm-up act' for (our own) > @Chris Angelico giving a talk about 'the walrus operator', his part in > that PEP, and how anyone-and-everyone can contribute to the Python > eco-system. > > My contribution was to start at the Python-Apprentice level, talking > about different types of 'operators', and preparing the stage?beach for > the more advanced 'walrus'. It culminated in a live-coding demo of > Conditional expressions/the "ternary operator". > > Live-coding demos are always better (for the audience) than passively > watching a progression of slides! However, that territory is labelled > 'here be dragons', for presenters! (continuing the tradition of slide > projectors which don't accept my cartridge/carousel, white boards > lacking pens with ink, over-head projectors with blown lamps (and a used > spare), RGB projectors which only/don't accept VGA cables, ...) > > Further: we've all suffered YouTube wannabes telling us how easy it is > to do 'something', typing and mis-typing and re-typing, and generally > wasting our time... (have they not heard of video-editing?) Those of us > who present 'live' (unlike my video-lectures), can't rely upon a later > 'cosmetic' stage to apply lip-stick on any 'pigs' in our typing! > > Rather than using a "script" document (as-in 'speaker's notes') to > prompt me with what to type next, the remote presentation tool > (BigBlueButton web-conferencing) allows the 'projection' of a (desktop) > terminal window - whilst hiding my text-editor. Thus, at the appropriate > moment, I was copy-pasting from my 'script' in xed, into the terminal's > Python REPL. Worked very well - it appears as if I'm a very fast typist! > Of course, sometimes I was copying one line of code at a time, and at > others, multiple lines - thus (*still*) giving opportunity to 'fluff my > lines'. Hah! > > For live-demos, I like to use pedagogical (teaching) 'patterns' of a > structured narrative (as one would with a lecture) but trying to > encourage involvement (if not "active learning"), using a "worked > example" (learning through demonstration), and "discovery" (which > because it is effectively a 'presentation', really means 'gradual > revelation'). > > (apologies for any non-obvious, non-Python, jargon - cognitive > psychology (learning how we learn) is my research field) > > Thus, the demo proceeds on a step-by-step basis. At each step the > process is: > 1 present a problem/ask a question > 2 ensure understanding/invite comments/accept suggestions > 3 present code snippet* > and (presumably) execute same to produce an 'answer' > 4 comment/discuss/critique > > - which, unless 'the end', should lead us back to nr1 for the 'next > step'... > > * in other scenarios, this might involve use of code suggested by the > audience! > > Before reading this thread, I had been thinking that Jupyter might > empower the combination of Python, 'steps', and 'live-coding'. However, > a notebook will likely display future steps on-screen, before the > current one has been completed (which defeats 'gradual revelation' - > somewhat like jumping to 'the last page to find-out who dunnit') - > unlike (say) presentation slides where no-one can see 'what comes > next'/jump ah
Re: The code version of python -i
Thanks folks will update with progress soon > -- https://mail.python.org/mailman/listinfo/python-list
The code version of python -i
Greetings, If i have a file name flower.py and i add x = 1 in it. When i run python -i flower.py i get a shell >>> If type x i get 1 >>> x 1 The values are auto injected. How do i start a shell by code with values already injected? Thanks Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: ANN: Version 0.5.1 of the Python config module has been released.
Used by 4.8k but only ... 4 stars -- https://mail.python.org/mailman/listinfo/python-list
Re: urgent
You need an IDE Check out: PyCharm Wing IDE Spyder ^^ Very few people use the in-built IDE -- https://mail.python.org/mailman/listinfo/python-list
Re: src layout for projects seems not so popular
Also a takeaway from my package experience is that even though __init__.py is not needed for module import, it's still needed for packaging (py3.8). Find won't find the module else. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
src layout for projects seems not so popular
Greetings list, Just an observation. Out of Github's trending repos for Python for today, I could find only 2 repos using the src layout. Matplotlib and another one. https://github.com/trending/python?since=daily Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Setup.py + src: Modules not found
Greetings list, I have this project: https://github.com/pyhoneybot/honeybot I badly wanted to use setup.cfg but editable mode is not allowed for now. I then switched back to setup.py. This is my first time with src/, my entry point is src/honeybot/manage.py:main now in editable mode i manage to get everything to work however, when installing from tar.gz i get from honeybot.api.main import Bot_core ModuleNotFoundError: No module named 'honeybot.api' like i have a hard time getting how exactly to import with src/ i guess everything was working as when i changed to honeybot.x, the package was installed but on a fresh release, it does not know what exactly is honeybot for the first time Q: In my case in modules what should i write to import from /api? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Pandas: Multiple CSVs in one Zip file
Greetings, Cannot read one file in a zip file if the zip file contains multiple files. This example does not work https://www.py4u.net/discuss/203494 as Pandas shows a ValueError: Multiple files found in ZIP file. Only one file per ZIP. If the Zip file has one file, fine else i cannot find a way. Thanks Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
[Python-announce]FlaskCon's Call For Volunteers Is On
Greetings list, As preparations for FlaskCon intensifies, the call for volunteers goes live: https://twitter.com/FlaskCon/status/1427542892642410502?s=20 You can also chip in directly here: https://docs.google.com/forms/d/e/1FAIpQLSfsHNBcclWSmVkk4LDD_EnlhrlKdWlGOakdwbt5PbaFklpHAA/viewform According to previsions, it might be the last Python conf of the year! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius ___ Python-announce-list mailing list -- python-announce-list@python.org To unsubscribe send an email to python-announce-list-le...@python.org https://mail.python.org/mailman3/lists/python-announce-list.python.org/ Member address: arch...@mail-archive.com
FlaskCon's Call For Volunteers Is On
Greetings list, As preparations for FlaskCon intensifies, the call for volunteers goes live: https://twitter.com/FlaskCon/status/1427542892642410502?s=20 You can also chip in directly here: https://docs.google.com/forms/d/e/1FAIpQLSfsHNBcclWSmVkk4LDD_EnlhrlKdWlGOakdwbt5PbaFklpHAA/viewform According to previsions, it might be the last Python conf of the year! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)
Greetings, Out of curiosity, how do people without a Code of Conduct manage and prevent abuse in between people? I was about to organise something last year but did not find a better solution than a code of conduct to ensure smoothness. Well the idea was a before-hand signed code of conduct. It becomes more of an agreement, a pact of good conduct. But i wonder how you handle banning it altogether? Like what happens in the case of abuse. What if you ban and people ask why? How do organisers justify their actions? Even if a code of conduct rings not great with some people, at least it can serve as a hint and guiding principles. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)
On Sun, May 9, 2021 at 1:58 PM dn via Python-list wrote: > That said, there is nothing to be gained by upsetting people... > I misquoted the relevant section from Chris' answer, i wanted to quote: *I'm not saying that the previous situation was GOOD, but I'm far fromsure that the current situation is any better - look at the argumentsregarding branch naming, which completely sidelined all technicalconsiderations in favour of one single political motivation basedheavily on the decisions of people from one specific country.* More about changes like the above. Nevertheless, when the Linux Foundation announced a discussion looking > into such (largely) US-concerning terms as Master/Slave in computing > contexts, the same newsletter blatantly localised events which were > publicised, and intended to draw, world-wide participation. > (and has yet to respond to my observation of same) > > The ISO 8601 International Standard recommends usage of UTC "Universal > Time" as a means for communicating times and dates in an international > or multinational context, ie "interchange". (So the LF's advert of a > Rust seminar commencing at a time listed in "CEST" is unfriendly and > somewhat inconsiderate to people outside Europe) > - example to prove we're not 'US-bashing', even though similar US-based > examples would be very easy to quote. > > ISO 8601 was updated with 'Part 2' in 2019. It deals with "common > expressions". Many of which are meaningless, or even misleading to > others. In this case, an invitation to "Spring Internships" seemed six > months early to me. However, it is 'now' to anyone in the US. Such > seasonal terms only apply to the temperate zones of this planet - > neither the tropics nor the poles have such seasons, plus many cultures > use other terms for specific times of year, eg "Monsoon Season". Thus, > are not appropriate for use amongst an international audience. > The examples you quote are very tangible, clearly defined and easily associated Master-slave has obvious meanings, CEST is associated with a particular area and preferring another timezone would put other people at disadvantages. The iso part 2 saute a l'oeil (triggers your sensors, litt. jumps at your eye), spring automatically spells confusions as spring goes in the same direction as timezones I was pointing out to politically related changes whose obviousness and correctness is not gauged from empirical analysis of elements in front of you but requires the further step of knowing what the American people deem as right or wrong not in the sense of morals directly but more of how the country and people live. Let's say the word mouse. A mouse is a mouse, the rodent. But now some bad people take the mouse as their symbol. They put the mouse on their bags, robes, curtains, laptops, pens thereby demonising the mouse. Now mouse lovers are also associated to these people as well as people who care for mouse wellness in laboratories. This happens in Fake Country X. Now some in a country studied English and learnt that a mouse is a four tiny- footed creature with a tail. Being a mouse lover the person decided to name a Python conference PyMouse. Now people start dramatising the situation and label the person as someone not to be collaborated with, someone to be banned from all Py affiliated enterprises. Well that is very bad to begin with. A mouse remains a mouse and the bad folks using the mouse as their symbol exists in majority only in Fake Country X. Someone outside Fake Country X never had the chance to study or imbibe himself with or come across the association of this with that. You presented some cases which are very valid and correct, but i was referring to changes which are not so blatant and obvious. Cases which are wrong for some people but right for others not because of moral correctness directly but more because of associations present in a particular country. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)
I meant to quote this part actually: I'm not saying that the previous situation was GOOD, but I'm far from sure that the current situation is any better - look at the arguments regarding branch naming, which completely sidelined all technical considerations in favour of one single political motivation based heavily on the decisions of people from one specific country. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)
On Sun, May 9, 2021 at 5:29 AM Chris Angelico wrote: > > Probably the same reason it has never worked. The only thing that's > changed is the social acceptability of vilifying those you don't like. > Once upon a time, there were those in the community who had all the > power, and those on the fringes that had none, and if someone on the > fringe misbehaved, everyone inside just shunned them and they left. > Now, if someone on the fringe misbehaves and everyone treats them > badly, there's a massive political kerfuffle and everyone gets hurt. Just a note here, though not in relation to CoC but as someone speaking English far away from a country called America, sometimes i wonder at some changes introduced just because it does not ring well within the country. I agree that the US pushed many many changes used around the world but English is not the property of the people of a specific country. The English community is the sum of people speaking English over the world. Though i am very far from CPython contributions but once changes no longer occur on the basis of technical reasons it raises eyebrows far beyond CPython contributors. Now in the Python community we must verify not only grammatical and structural errors but also US-based nuances in the language. This requires community folks to be in tune with American current affairs and ideological tendencies. This might be a bit too much work as the bridge of union of the community is the Python language, usage and tools. Though English is a core-part of the programming language, this is going too deep. A practical effect of this is that each and every event posters, flyers and websites have to be double checked against US nuances and phrasing. And the PSF must make sure that events sponsored by it or affiliated must follow the same standards. This post is in no way a US-bashing one, or intended to be hurtful in any way. It's an observation that some changes appear totally ok to english speakers until you understand that this and that sounds wrong in a particular country. This poses the question of the legitimacy of the influence of a certain nation over the PSF. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Understanding PyPi download stats
Greetings list, See these two links below providing download stats for a package: 1) https://pypistats.org/packages/shopyo 2) https://pepy.tech/project/shopyo Particularly for 2) Are the data accurate? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Bloody rubbish
@Gene Heskett That ran deep. I was going to ask you were doing in PythonLand but you answered it at the end. Maybe i should ask what made you interested in Python in the first place? -- https://mail.python.org/mailman/listinfo/python-list
Re: Proposal: Disconnect comp.lang.python from python-list
It was high time a proposal like that came up We have seen from time to time some comp lang interruptions ~ -- https://mail.python.org/mailman/listinfo/python-list
Re: XanaNews Statistic for comp.lang.python. 4/1/2021 5:52:47 AM
So, is that mail spam or ...? -- https://mail.python.org/mailman/listinfo/python-list
Re: .title() - annoying mistake
Greetings, Missing the 'S renders in my opinion the method unfit to be included in it's current form. It is a call to improve it if possible. We wonder why in the first place such a method exists. If indeed it intends to capitalise all first letters, putting others in lowercase, the ' is a too common case to be ignored. The intent was: "Return a titlecased version of the string where words start with an uppercase character and the remaining characters are lowercase." But the ' is a case acknowledged by the docs: "The algorithm uses a simple language-independent definition of a word as groups of consecutive letters. The definition works in many contexts but it means that apostrophes in contractions and possessives form word boundaries, which may not be the desired result: ... A workaround for apostrophes can be constructed using regular expressions: ..." Why not do it if you know people miss it? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: .title() - annoying mistake
At least i'd expect what it pretends to do even if not following English. Missing ' is a weird behaviour, i get it they skipped every non lettet On Fri, 19 Mar 2021, 22:50 Grant Edwards, wrote: > > In English, certain words are not capitalized in titles unless they're > the first word in the title (short articles and prepositions), and > .title() doesn't get that right either: > > >>> "the man in the grey flannel suit".title() > 'The Man In The Grey Flannel Suit' > > should be > > 'The Man in the Grey Flannel Suit' > -- https://mail.python.org/mailman/listinfo/python-list
Re: .title() - annoying mistake
On Fri, 19 Mar 2021, 22:07 MRAB, wrote: > You want English "man's" to become "Man's", but French "l'homme" to > become "L'Homme". It's language-dependant. > Ah depends on a language (English i guess). Thanks > -- https://mail.python.org/mailman/listinfo/python-list
Re: .title() - annoying mistake
Aie sorry, Did not know it targetted the non-english speakers. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: .title() - annoying mistake
It's about unnecessary capitalisation for a common use case in English. You can see it in action on my site: https://www.compileralchemy.com/#articles see 24. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: .title() - annoying mistake
Thanks very much! That's annoying. You have to roll your own solution! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius > -- https://mail.python.org/mailman/listinfo/python-list
.title() - annoying mistake
Greetings list, See this: >>> "Python's usage".title() "Python'S Usage" It should have been Python's Usage Why capitalise the S? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Packaging/MANIFEST.in: Incude All, Exclude .gitignore
Greetings list, SInce i have a .gitignore, how do i exclude all files and folders listed by my gitignore? How do i include everything by default? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: New Python implementation
Greetings, age: After university to retirement level: school, A Level is high school, not university -- https://mail.python.org/mailman/listinfo/python-list
Re: New Python implementation
Greetings list, > Even if Python is my choice language for personal projects, I am not certain it is the right language to use in a classroom context. This sums the view of most teachers in my country. In here for A level at Cambridge for Computer Studies you can choose either Java, or VB or Python The teachers' logic seems to tell them that VB is the simplest of all and more fitted for students. Since we organise the local Python usergroup <https://www.pymug.com>, we have been encouraging the adoption of Python. This happens from experience when teachers think for students, they think student will think like that etc The way schools examinations are set up, learning programming is a bore. Programming requires experimentation and projects. The students must be permitted to explore the wide deep sea that is Python. On one of my projects on Github, i have a toy language, someone from Slovakia (14 years old) built an IDE for it, what was needed was only guidance where he was stuck. The hurdle with Python if any is the setting up and getting the command 'python' to appear in the terminal, which is very easy to get up and running nowadays. When i was in high school, i did not take Computer Studies, but was learning programming on my own, including Python. The irony is that my friends who were learning Python got disgusted with it. Loops and functions turned out to be hard for them. That's because learning for the exam makes you learn the language close to theory. Some commandline stuffs and some numbers stuffs surely is not exiting. Mastery comes with projects, exciting ones. Then whatever the syllabus requires becomes easy. It's a means to an end rather than the end in itself. The teachers' reaction is a reaction to the design of the syllabus. The folks seem to think that let's water it down to a very theoretical approach, strike out practise, strike out the fun out of it and sure the students will find it easier. Since effort is disliked by humans, less effort in learning programming will make students happy. Then, if it was no Python at that time, it might be no Python for life. With that mindset ongoing, those students think they know Python, they studied it, but they missed the whole thing. Forest, trees and leaves. They know only the color of the sign board leading to the place. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: New Python implementation
After reading the thread i'm like: where can i try it out ... On Thu, 11 Feb 2021, 16:38 Mr Flibble, wrote: > > Hi! > > I am starting work on creating a new Python implementation from scratch > using "neos" my universal compiler that can compile any programming > language. I envision this implementation to be significantly faster than > the currently extant Python implementations (which isn't a stretch given > how poorly they perform). > > Sample neos session (parsing a fibonacci program, neoscript rather than > Python in this case): > > neos 1.0.0.0 ED-209 > ] help > h(elp) > s(chema)Load language schema > l(oad) Load program > list List program > c(ompile)Compile program > r(un)Run program > ![] Evaluate expression (enter > interactive mode if expression omitted) > : Input (as stdin) > q(uit) Quit neos > lc List loaded concept libraries > t(race) <0|1|2|3|4|5> [] Compiler trace > m(etrics)Display metrics for running > programs > ] lc > [neos.core] (file:///D:\code\neos\build\win32\vs2019\x64\Release\core.ncl) >[neos.boolean] >[neos.language] >[neos.logic] >[neos.math] >[neos.module] >[neos.object] >[neos.string] > [neos.math.universal] > (file:///D:\code\neos\build\win32\vs2019\x64\Release\core.math.universal.ncl) > ] s neoscript > Loading schema 'neoscript'... > Language: Default neoGFX scripting language > Version: 1.0.0 > Copyright (C) 2019 Leigh Johnston > neoscript] l examples/neoscript/fibonacci.neo > neoscript] list > File 'examples/neoscript/fibonacci.neo': > -- neoscript example: Fibonacci > > using neos.string; > using neos.stream; > > import fn to_string(x : i32) -> string; > import fn to_integer(s : string) -> i32; > import proc input(s : out string); > import proc print(s : in string); > > -- functions are pure > def fn add(x, y : i32) -> i32 > { > return x + y; > } > def fn fib(x : i32) -> i32 > { > if (x < 2) > return 1; > else > return add(fib(x-1), fib(x-2)); > } > > -- procedures are impure > def proc main() > s : string; > { > print("Enter a positive " > "integer: "); > input(s); > print("Fibonacci(" + s + ") = " + to_string(fib(to_integer(s))) + > "\n"); > } > neoscript] t 1 > neoscript] c > folding: string.utf8() <- string.utf8.character.alpha() > folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(g) > folding: string.utf8(g) <- string.utf8.character.alpha() > folded: string.utf8(g) <- string.utf8.character.alpha() = string.utf8(gn) > folding: string.utf8(gn) <- string.utf8.character.alpha() > folded: string.utf8(gn) <- string.utf8.character.alpha() = string.utf8(gni) > folding: string.utf8(gni) <- string.utf8.character.alpha() > folded: string.utf8(gni) <- string.utf8.character.alpha() = > string.utf8(gnir) > folding: string.utf8(gnir) <- string.utf8.character.alpha() > folded: string.utf8(gnir) <- string.utf8.character.alpha() = > string.utf8(gnirt) > folding: string.utf8(gnirt) <- string.utf8.character.alpha() > folded: string.utf8(gnirt) <- string.utf8.character.alpha() = > string.utf8(gnirts) > folding: string.utf8(gnirts) <- string.utf8.character.period() > folded: string.utf8(gnirts) <- string.utf8.character.period() = > string.utf8(gnirts.) > folding: string.utf8(gnirts.) <- string.utf8.character.alpha() > folded: string.utf8(gnirts.) <- string.utf8.character.alpha() = > string.utf8(gnirts.s) > folding: string.utf8(gnirts.s) <- string.utf8.character.alpha() > folded: string.utf8(gnirts.s) <- string.utf8.character.alpha() = > string.utf8(gnirts.so) > folding: string.utf8(gnirts.so) <- string.utf8.character.alpha() > folded: string.utf8(gnirts.so) <- string.utf8.character.alpha() = > string.utf8(gnirts.soe) > folding: string.utf8(gnirts.soe) <- string.utf8.character.alpha() > folded: string.utf8(gnirts.soe) <- string.utf8.character.alpha() = > string.utf8(gnirts.soen) > folding: source.package.name() <- string.utf8(gnirts.soen) > folded: source.package.name() <- string.utf8(gnirts.soen) = > source.package.name(neos.string) > folding: source.package.import() <- source.package.name(neos.string) > folded: source.package.import() <- source.package.name(neos.string) = > source.package.import(neos.string) > folding: source.package.import(neos.string) <- > source.package.import(neos.string) > folding: string.utf8() <- string.utf8.character.alpha() > folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(g) > folding: string.utf8(g) <- string.utf8.character.alpha() > folded: string.utf8(g) <- string.utf8.character.alpha() = string.utf8(gn) > folding: string.utf8(gn) <- string.utf8.character.alpha() > folded: string.utf8(gn) <- string.utf8.character.alpha() =
Re: Venv behaviour change py3.9
Well i am no longer on the PC but here are some more info: windows 10, 64bit I downloaded Python 3.9 yesterday, added the root folder to path renamed python.exe to py39.exe and did py39 -m venv venv the output was No such file or directory but i dont remember the exact phrase Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Sun, Feb 14, 2021 at 6:45 PM Barry Scott wrote: > > > > On 14 Feb 2021, at 09:42, Abdur-Rahmaan Janhangeer > wrote: > > > > Greetings all, > > > > on 3.7 when i do > > > > $ python -m venv venv > > > > it creates a venv in venv folder > > > > but on 3.9 it returns no such file or directory > > > > os: windows. Any ideas on why the behaviour changes? > > I did this on wndows 10 and no error seen: > > py -3.9 -m venv venv > > Are you running the version of python that you expect? > What does python -V tell you? > > Can you cut-n-paste The command and its output? > > Barry > > > > -- > > https://mail.python.org/mailman/listinfo/python-list > > > > -- https://mail.python.org/mailman/listinfo/python-list
Venv behaviour change py3.9
Greetings all, on 3.7 when i do $ python -m venv venv it creates a venv in venv folder but on 3.9 it returns no such file or directory os: windows. Any ideas on why the behaviour changes? -- https://mail.python.org/mailman/listinfo/python-list
Re: A beginning beginner's question about input, output and . . .
Greetings, Web with Python is really easy to get started with, here is a simple endpoint with a framework called Flask from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World’ if __name__ == '__main__': app.run() As for Tkinter, it's really annoying. PyQt5 and others are a lot better. PyQt5 follows the Cpp function namings Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Tue, Jan 12, 2021 at 12:43 AM DonK wrote: > > Hi, I'm thinking about learning Python but I'm 74 years old and will > very likely not ever have a programming job again. I used to program > in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe" > languages. It's been about 18-19 years since my last programming job. > I do understand programming concepts but I'm really not up on any of > the more modern programming languages. > > I've installed Python 3.7, the PyCharm IDE and watched some Youtube > tutorials but it's been stretched out over about 1.5 years so I'll > probably need to go back to the beginning. My problem is that I don't > understand how Python programs are used. (i.e user input and output) > Is Python mainly used for backends? > > I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they > look kinda like adding a family room onto a 1986 double wide mobile > home, and they look even more complicated than creating a GUI from > scratch in C++ with a message loop, raising events . . . > > So, what do you folks use Python for? > > Nowdays I mainly just use programming for rather small utilities for > my personal use. Currently I'd like to write something to iterate > through open windows and save them to different folders depending on > if the titlebar contains certain strings. In the past I would probably > have used Excel's VBA to do this but I no longer have Excel installed > on my main computer. I'd like a bit of a challenge but I don't want to > spin my wheels trying to learn something that will be a dead end for > me. > > I know that this probably seems like a stupid post but your input will > be useful. > > Thank you. > >Don > > I know that Python is a very popular language so I'm sorry if it > sounds like I'm being critical. I really don't know enough about it to > be critical. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Mauritius Usergroup - End of Year report 2020
Greetings, ^^ Thanks! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Sun, Jan 3, 2021 at 8:12 AM dn via Python-list wrote: > On 1/3/21 5:01 PM, Abdur-Rahmaan Janhangeer wrote: > > Greetings list, > > > > Here's our usergroup's end of year report for 2020: > > Happy reading! > > > > https://www.pymug.com/assets/pymug_end_of_year_2020_v2.pdf > > > Well done @A-R! > -- > Regards =dn > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Python Mauritius Usergroup - End of Year report 2020
Greetings list, Here's our usergroup's end of year report for 2020: Happy reading! https://www.pymug.com/assets/pymug_end_of_year_2020_v2.pdf Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Does windows edit .py file shebangs?
Greetings list, Being a windows user since long, this made me laugh. Tell me 1/ What version of Python are you running? 2/ What editor/IDE are you using? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius On Fri, Jan 1, 2021 at 8:43 PM Barry Scott wrote: > I found python scripts have had their shebang lines edited behind my back. > > The shebang line I'm seeing is: > > #!C:\Users\barry\AppData\Local\Microsoft\WindowsApps\python3.EXE > > Is this Microsoft being "helpful"? > Does anyone know what I will have done to best with this "help"? > > What do I need to do to prevent this happening? > > Barry > > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Lambda in parameters
Greetings list, Jane Street is well known for its love of functional programming in general and of OCaml in particular. If you don't know OCaml yet, I highly recommend it. You can think of it as Python with (static) types. Yes i know OCaml when i was exploring haskell and the like. At that time i was looking for companies who use OCaml etc Did not come across Jane Street (If you know someone from there tell them the question writer has a really twisted mind ^^)/. I don't understand why though you would prefer OCaml over Python, Go, Java etc for a company ^^ Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Lambda in parameters
Greetings list, Why car and cdr? Well obviously car is content of the address register and cdr is content of data register. Apparently an artefact of a early implementation of lisp. Oh did not know that detail. More twists for sure. Thought lisp did not go lowlevel. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Lambda in parameters
Greetings, Very clear explanations, rewriting lambdas as a function was the key to understand it. Did not know was a lisp inspiration. My mind still spiralling XD Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Lambda in parameters
The Question: # --- This problem was asked by Jane Street. cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4. Given this implementation of cons: def cons(a, b): def pair(f): return f(a, b) return pair Implement car and cdr. # --- Kind Regards, Abdur-Rahmaan Janhangeer https://www.github.com/Abdur-RahmaanJ Mauritius sent from gmail client on Android, that's why the signature is so ugly. On Fri, 18 Dec 2020, 10:02 Cameron Simpson, wrote: > On 17Dec2020 23:52, Abdur-Rahmaan Janhangeer wrote: > >Here is a famous question's solution > > These look like implementations of Lisp operators, which I've never > found easy to remember. So I'll do this from first principles, but > looking at the (uncommented) code. > > This is some gratuitiously tricky code. Maybe that's needed for these > operators. But there's a lot here, so let's unpick it: > > >def cons(a, b): > >def pair(f): > >return f(a, b) > >return pair > > Cons returns "pair", a function which itself accepts a function "f", > calls it with 2 values "a, b" and returns the result. For ultra > trickiness, those 2 values "a, b" are the ones you passed to the initial > call to cons(). > > This last bit is a closure: when you define a function, any nonlocal > variables (those you use but never assign to) have the defining scope > available for finding them. So the "pair" function gets "a" and "b" from > those you passed to "cons". > > Anyway, cons() returns a "pair" function hooked to the "a" and "b" you > called it with. > > >def car(c): > >return c(lambda a, b: a) > > The function accepts a function, and calls that function with "lambda a, > b: a", which is itself a function which returns its first argument. You > could write car like this: > > def car(c): > def first(a, b): > return a > return c(first) > > The lambda is just a way to write a simple single expression function. > > >print(cons(1, 2)(lambda a, b: a)) > > What is "cons(1,2)". That returns a "pair" function hooked up to the a=1 > and b=2 values you supplied. And the pair function accepts a function of > 2 variables. > > What does this do? > > cons(1, 2)(lambda a, b: a) > > This takes the function returns by cons(1,2) and _calls_ that with a > simple function which accepts 2 values and returns the first of them. > > So: > > cons(1,2) => "pair function hooked to a=1 and b=2" > > Then call: > > pair(lambda a, b: a) > > which sets "f" to the lambda function, can calls that with (a,b). So it > calls the lambda function with (1,2). Which returns 1. > > >print(car(cons(1, 2))) > > The "car" function pretty much just embodies the call-with-the-lambda. > > >but i don't understand how lambda achieves this > > If you rewite the lambda like this: > > def a_from_ab(a,b): > return a > > and then rewrite the first call to cons() like this: > > cons(1,2)(a_from_ab) > > does it make any more sense? > > Frankly, I think this is a terrible way to solve this problem, whatever > the problem was supposed to be - that is not clear. > > On the other hand, I presume it does implement the Lisp cons and car > functions. I truly have no idea, I just remember these names from my > brief brush with Lisp in the past. > > Cheers, > Cameron Simpson > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Lambda in parameters
Greetings list, Here is a famous question's solution def cons(a, b): def pair(f): return f(a, b) return pair def car(c): return c(lambda a, b: a) print(cons(1, 2)(lambda a, b: a)) print(car(cons(1, 2))) The aim of car is to return 1 but i don't understand how lambda achieves this Kind Regards, Abdur-Rahmaan Janhangeer https://www.github.com/Abdur-RahmaanJ Mauritius sent from gmail client on Android, that's why the signature is so ugly. -- https://mail.python.org/mailman/listinfo/python-list
Documenting the Python Community
Greetings list, I have a project in mind to help document the Python community. It involves among others keeping a within reach info of user groups (name, location, contact) and checking activity status. Sending the mail to this list since i could not find a <https://www.python.org/psf/committees/> community <https://www.python.org/psf/committees/> workgroup. I know Mr Chris is in the Wiki team and that Mrs McKellar once toured Python usergroup spaces for a PSF community-related initiative many years ago. Besides those i don't know any specific person who might be interested This occurs after we organised <https://flaskcon.com> FlaskCon <https://www.youtube.com/channel/UC3QC5pASs8v5YVxKwJDtZeQ>. It was an ugly experience contacting user groups around the world. The wiki is outdated. Many user groups are no longer active, some websites are down, others have weird ways of communicating. This mail is basically to gather interested folks together with the hope of hatching a minimum viable plan d'action. Being myself a usergroup organiser <https://www.pymug.com>, we'd like to find a way to 1. make user groups compliant to a minimum standard 2. put the appropriate mechanism in place so that the PSF can easily have a watch over user groups and give them some bumps from time to time 3. some kind of onboarding and advices for new user groups In parallel I am also thinking of documenting user groups histories, starting with those I have some sort of relationship with. The idea behind is to reinforce the community touch. The draft might seem a tedious task for the expected benefits but with the right approach it will be smooth. Feel free to continue the conversation! Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://abdur-rahmaanj.github.io/> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: What might cause my sample program to forget that already imported datetime?
Btw why a datetime in datetime? It causes much confusion. I dont know the design decision behind, if someone knows, it might be good to explain I dont expect it to change anytime soon due to backward compatibility, but just for knowledge. Kind Regards, Abdur-Rahmaan Janhangeer https://www.github.com/Abdur-RahmaanJ Mauritius sent from gmail client on Android, that's why the signature is so ugly. -- https://mail.python.org/mailman/listinfo/python-list
Re: Faking stdlib
The last time this was raised, it seemed that folks in here don't have a clear idea of what the standard library is ^^ https://mail.python.org/archives/list/python-id...@python.org/thread/XSYEVRPJQUX7VBTPNIJMUFZQIZ7WLOQU/ A summary: https://lwn.net/Articles/794458/ Kind Regards, Abdur-Rahmaan Janhangeer https://www.github.com/Abdur-RahmaanJ Mauritius sent from gmail client on Android, that's why the signature is so ugly. -- https://mail.python.org/mailman/listinfo/python-list
Re: Importing from within package
Thanks for the lead. Checking tomorrow! If so i'll have to include other folders as well ... Kind Regards, Abdur-Rahmaan Janhangeer https://www.github.com/Abdur-RahmaanJ Mauritius sent from gmail client on Android, that's why the signature is so ugly. -- https://mail.python.org/mailman/listinfo/python-list