Data structures and Algorithms

2020-06-30 Thread satyaprasad
Hi, I am currently in learning process of python have been worked on
some desktop application using pyqt . I want improve my DSA area but i
searched so many videos mot sure how to start . 1.Do i really need learn
datastructures in c or c++ to get complete logical details. 2 .or shall
i start learn using python itself then where to start . Can some one
give me a road map for DSA with python.

I am Beginner

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: property

2020-06-30 Thread ast

Le 26/06/2020 à 10:16, R.Wieser a écrit :

ast,





I have absolutily /no idea/ about how that "fahrenheit = property()" comes
into play though.   



It just creates an empty property object.

You can then fill this object with the read/write/delete functions
with the methods getter, setter, deleter
--
https://mail.python.org/mailman/listinfo/python-list


Re: Data structures and Algorithms

2020-06-30 Thread Cameron Simpson
On 30Jun2020 10:52, satyaprasad  wrote:
>Hi, I am currently in learning process of python have been worked on
>some desktop application using pyqt . I want improve my DSA area but i
>searched so many videos mot sure how to start . 1.Do i really need learn
>datastructures in c or c++ to get complete logical details. 2 .or shall
>i start learn using python itself then where to start . Can some one
>give me a road map for DSA with python.

In my opinion you are better off using Python. In C and (less so) in C++ 
there is a lot of cruft around managing memory and allocating sizes, not 
to mention additional verbiage. In Python you are far freer to 
concentrate on the data structures and algorithms themselves.

Maybe start here:


https://duckduckgo.com/html?q=python%20data%20structures%20and%20algorithms%20tutorials

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: property

2020-06-30 Thread ast

Le 26/06/2020 à 15:12, Peter Otten a écrit :

Unknown wrote:




The getter/setter of the property builtin return a new property



p = property()
q = p.getter(None)
p is q

False

where you


  def getter(self, fget):
  self.fget = fget
  return self


modify the existing one.

  


Yes you are right. Thank you for noticing that.

My property seems better since you can choose any names
for the functions to be used for fget, fset and fdel.



--
https://mail.python.org/mailman/listinfo/python-list


Re: Data structures and Algorithms

2020-06-30 Thread Richard Damon
On 6/30/20 8:26 AM, Cameron Simpson wrote:
> On 30Jun2020 10:52, satyaprasad  wrote:
>> Hi, I am currently in learning process of python have been worked on
>> some desktop application using pyqt . I want improve my DSA area but i
>> searched so many videos mot sure how to start . 1.Do i really need learn
>> datastructures in c or c++ to get complete logical details. 2 .or shall
>> i start learn using python itself then where to start . Can some one
>> give me a road map for DSA with python.
> In my opinion you are better off using Python. In C and (less so) in C++ 
> there is a lot of cruft around managing memory and allocating sizes, not 
> to mention additional verbiage. In Python you are far freer to 
> concentrate on the data structures and algorithms themselves.
>
> Maybe start here:
>
> 
> https://duckduckgo.com/html?q=python%20data%20structures%20and%20algorithms%20tutorials
>
> Cheers,
> Cameron Simpson 

I would disagree a bit here, a lot depends on WHY and WHAT you want to
learn about Data Structures and Algorithms. A lot of learning Data
Structures is learning to understand the actual typical structure of the
Data Structure, and seeing the explicit pointers can be helpful here.

Python may be better for the Algorithms side, where hiding some of the
gritty detail can be more useful, though that hiding might obscure some
details if you want to think about what is the complexity of an operation.

-- 
Richard Damon

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Assign Excel cell value from Datepicker widget Selection using Python

2020-06-30 Thread narenchunduri
Thx kushal for your valuable points
-- 
https://mail.python.org/mailman/listinfo/python-list


Code of Conduct address "hold message"

2020-06-30 Thread Rhodri James
Having just had occasion to use the code of conduct link 
(conduct...@python.org), I got back the message:


  Your mail to 'conduct...@python.org' with the subject



  Is being held until the list moderator can review it for approval.

etc.  I know this is the standard moderation message, but it seems 
rather out of place for the CoC address.  It's not the least bit 
reassuring if you feel uncomfortable about making such reports, as some 
people (myself included) are.  If I were emailing a commercial company's 
complaints line I would expect something more in the nature of


  Thank you for your email about "".  We will deal with
  it as soon as we can."

Plus the usual platitudes about valuing my input and appreciating my 
custom which don't necessarily apply here ;-/


Any chance of getting the message altered to something a bit more friendly?

--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


How to handle async and inheritance?

2020-06-30 Thread Stephen Rosen
Hi all,

I'm looking at a conflict between code sharing via inheritance and async
usage. I would greatly appreciate any guidance, ideas, or best practices
which might help.

I'll speak here in terms of a toy example, but, if anyone wants to look at
the real code, I'm working on webargs. [1] Specifically, we have a `Parser`
class and an `AsyncParser` subclass, and the two have a lot of code
duplication to handle async/await. [2]


I've got an inheritance structure like this:

class MyAbstractType: ...
class ConcreteType(MyAbstractType): ...
class AsyncConcreteType(MyAbstractType): ...

One of my goals, of course, is to share code between ConcreteType and
AsyncConcreteType via their parent.
But the trouble is that there are functions defined like this:

class MyAbstractType:
def foo(self):
x = self.bar()
y = self.baz(x)
... # some code here, let's say 20 lines

class AsyncConcreteType(MyAbstractType):
async def foo(self):
x = await self.bar()
y = self.baz(x)
... # the same 20 lines as above, but with an `await` added
every-other line


I'm aware that I'm looking at "function color" and that my scenario is
pitting two language features -- inheritance and async -- against one
another. But I don't see a clean way out if we want to support an
"async-aware" version of a class with synchronous methods.

What I tried already, which I couldn't get to work, was to either fiddle
with things like `inspect` to see if the current function is async or to
use a class variable to indicate that the current class is the async
version. The idea was to write something like

class MyAbstractType:
_use_async_calls = False
def foo(self):
x = self._await_if_i_am_async(self.bar)
y = self.baz(x)
...

and that way, the async subclass just needs to change signatures to be
async with little stubs and set the flag,

class AsyncConcreteType(MyAbstractType):
_use_async_calls = True
async def foo(self):
return super().foo()
async def bar(self):
return super().bar()

but this (some of you are ahead of me on this, I'm sure!) did not work at
all. I couldn't find any way to write `_await_if_i_am_async`, other than
possibly doing some weird things with `exec`.
Once I concluded that the python wouldn't let me decide whether or not to
use await at runtime, at least with tools of which I'm aware, I basically
gave up on that route.


However, it seems like there should be some clever technique for defining
`MyAbstractType.foo` such that it awaits on certain calls *if* there's some
indication that it should do so. It's obviously possible with `exec`, but I
don't want to convert all of the core codepaths into giant `exec` blocks.
Perhaps there's a way which is safer and more maintainable though?


If anyone has experience in this space and can offer up a good solution, I
would love to hear about it.
And if someone wants to go above-and-beyond and look at webargs, and
suggest a better way for us to support aiohttp, I'd obviously welcome that
kind of help as well!

Thanks in advance, and best regards,
-Stephen


[1] https://github.com/marshmallow-code/webargs
[2]
https://github.com/marshmallow-code/webargs/blob/6668d267fa4135cf3f653e422bd168298f2213a8/src/webargs/asyncparser.py#L24
-- 
https://mail.python.org/mailman/listinfo/python-list


[RELEASE] Python 3.8.4rc1 is now ready for testing

2020-06-30 Thread Łukasz Langa
Python 3.8.4rc1 is the release candidate of the fourth maintenance release of 
Python 3.8. Go get it here:
https://www.python.org/downloads/release/python-384rc1/ 

Assuming no critical problems are found prior to 2020-07-13, the scheduled 
release date for 3.8.4, no code changes are planned between this release 
candidate and the final release.

That being said, please keep in mind that this is a pre-release and as such its 
main purpose is testing.

Maintenance releases for the 3.8 series will continue at regular bi-monthly 
intervals, with 3.8.5 planned for mid-September 2020.

What’s new?

The Python 3.8 series is the newest feature release of the Python language, and 
it contains many new features and optimizations. See the “What’s New in Python 
3.8 ” document for more 
information about features included in the 3.8 series.

This is the first bugfix release that is considerably smaller than the previous 
three. There’s 20% less changes at 130 commits than the average of previous 
three releases. Detailed information about all changes made in version 3.8.4 
specifically can be found in its change log 
.

We hope you enjoy Python 3.8!

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 organization contributions to the Python Software 
Foundation.

Your friendly release team,
Ned Deily @nad 
Steve Dower @steve.dower 
Łukasz Langa @ambv 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Data structures and Algorithms

2020-06-30 Thread DL Neil via Python-list

On 1/07/20 1:18 AM, Richard Damon wrote:

On 6/30/20 8:26 AM, Cameron Simpson wrote:

On 30Jun2020 10:52, satyaprasad  wrote:

Hi, I am currently in learning process of python have been worked on
some desktop application using pyqt . I want improve my DSA area but i
searched so many videos mot sure how to start . 1.Do i really need learn
datastructures in c or c++ to get complete logical details. 2 .or shall
i start learn using python itself then where to start . Can some one
give me a road map for DSA with python.

In my opinion you are better off using Python. In C and (less so) in C++
there is a lot of cruft around managing memory and allocating sizes, not
to mention additional verbiage. In Python you are far freer to
concentrate on the data structures and algorithms themselves.

Maybe start here:

 
https://duckduckgo.com/html?q=python%20data%20structures%20and%20algorithms%20tutorials

Cheers,
Cameron Simpson 


I would disagree a bit here, a lot depends on WHY and WHAT you want to
learn about Data Structures and Algorithms. A lot of learning Data
Structures is learning to understand the actual typical structure of the
Data Structure, and seeing the explicit pointers can be helpful here.

Python may be better for the Algorithms side, where hiding some of the
gritty detail can be more useful, though that hiding might obscure some
details if you want to think about what is the complexity of an operation.



Yes, there's quite a bit of room for discussing what to learn and why 
one might want to learn such; expanding into 'what is ComSc' and why/how 
might learning such topics benefit a professional programmer (or 
specialist in one particular arena); and the list goes on...


For decades I have lusted (well, almost) for a copy of Knuth's library 
(but it is NOT a training resource). However, I also reflect that a lot 
of our study as u/grads, eg learning and comparing multiple sorting 
algorithms; is almost irrelevant these days, and with Python - sort() is 
at-least 'good enough' for 99% of (my) in-RAM applications.

(and Knuth started his collection of algorithms in the 1960s, IIRC)


To the OP: recommending you view both Coursera.org and edX.org. The 
likes of Georgia Tech and U.Mich[igan] offer series of courses using 
Python as their illustration language. In combination with increasing 
your Python skills, you will thus be able to follow a structured series, 
or to pick-and-choose from their syllabi to suit your particular 
needs/interests.


Courses are usually chargeable, but most can be "audited" for $free (you 
might have to wind through the dialog-boxes, and will likely not be able 
to submit exams/assignments for consideration)


(Disclosure: I train using edX - but not in Python)
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Code of Conduct address "hold message"

2020-06-30 Thread Rhodri James

On 30/06/2020 15:25, Rhodri James wrote:
Having just had occasion to use the code of conduct link 
(conduct...@python.org), I got back the message:


   Your mail to 'conduct...@python.org' with the subject

     

   Is being held until the list moderator can review it for approval.


Ah, it looks like the message I was expecting is generated when the 
moderator actually picks up the complaint, so that's OK.  The generic 
moderation message is still rather off-putting, though.


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: Pycharm Won't Do Long Underscore

2020-06-30 Thread Peter J. Holzer
On 2020-06-25 11:56:47 -0600, Michael Torrie wrote:
> On 6/24/20 7:38 PM, Grant Edwards wrote:
> > On 2020-06-24, Peter J. Holzer  wrote:
> >> There is U+FF3F Fullwidth Low Line.
> >>
> >>> If there were, Python would not know what to do with it
> >>
> >> You can use it in variable names, but not at the beginning, and it isn't
> >> equivalent to two underscores, of course:
> > 
> > Ouch.  Anybody caught using that should be fed to a large snake.
> 
> Even allowing unicode letters in variable names period is questionable,
> but that loud debate was over years ago.  Fortunately I have never seen
> any python code in the wild with non-latin characters for variable
> names.

When I use German words as identifiers (I try to avoid this, but
sometimes translating to English would just confuse everybody), I do use
umlauts. I have also used Greek letters for physical quantities (e.g., ω
for angular velocity).

> Would make editing code very painful for developers from different
> locales and keyboards.

Yeah, editor support is a problem[1]. For my code with German identifiers
it is very unlikely that anybody who doesn't use German daily (and hence
already has the need to type umlauts) will ever have to edit it. The
Greek characters are in private code only.

hp


[1] I use vim. Digraphs are a bit awkward but good enough for medium
rare[2] characters. I don't know how to type characters not on the
keyboard[3] in VS code or PyCharm or Emacs or whatever others are
using. "I can't edit your code because I can't type that variable
name" is certainly not something I want to hear from my colleagues.

[2] Pun not intended.

[3] Includes compose-sequences, if the keyboard has a compose key.

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: FW: Pycharm Won't Do Long Underscore

2020-06-30 Thread Peter J. Holzer
On 2020-06-24 15:33:16 -0600, Joe Pfeiffer wrote:
> One other note -- while you may want various good-looking fonts with
> ligatures in other domains, for writing code a monospace font with no
> ligatures lets you see exactly what's there and saves a host of
> problems.  My personal favorite for these purposes is called "Terminus
> Regular", but which specific one you pick is much less important than
> that you use one.

I agree. Although there are some fonts with special ligatures for
programming. I have never used one, but that seems like an interesting
concept.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: FW: Pycharm Won't Do Long Underscore

2020-06-30 Thread Joe Pfeiffer
"Peter J. Holzer"  writes:

> On 2020-06-24 15:33:16 -0600, Joe Pfeiffer wrote:
>> One other note -- while you may want various good-looking fonts with
>> ligatures in other domains, for writing code a monospace font with no
>> ligatures lets you see exactly what's there and saves a host of
>> problems.  My personal favorite for these purposes is called "Terminus
>> Regular", but which specific one you pick is much less important than
>> that you use one.
>
> I agree. Although there are some fonts with special ligatures for
> programming. I have never used one, but that seems like an interesting
> concept.

I've never heard of that before.  I'd be curious to try one.
-- 
https://mail.python.org/mailman/listinfo/python-list


Understanding interoperability

2020-06-30 Thread David Lowry-Duda
I have quite a bit of experience with various programming languages, 
including python, C, C++, and lisp. But I very rarely work on projects 
that use interoperability. This is something that I'd like to learn more 
about.

Sometimes, for numerical computing, I use cython as a binding layer 
between C++ and python, but that's the extent of my experience. I'm 
under the impression that if one were to want to use something like lisp 
(like say ecl embeddable common lisp), C, and python together, the 
process boils down to writing a lot of wrappers in C. And more 
generally, C is a frequent lowest-common-denominator language. Is my 
understanding right?

- DLD

-- 
David Lowry-Duda  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Understanding interoperability

2020-06-30 Thread Chris Angelico
On Wed, Jul 1, 2020 at 9:37 AM David Lowry-Duda  wrote:
>
> I have quite a bit of experience with various programming languages,
> including python, C, C++, and lisp. But I very rarely work on projects
> that use interoperability. This is something that I'd like to learn more
> about.
>
> Sometimes, for numerical computing, I use cython as a binding layer
> between C++ and python, but that's the extent of my experience. I'm
> under the impression that if one were to want to use something like lisp
> (like say ecl embeddable common lisp), C, and python together, the
> process boils down to writing a lot of wrappers in C. And more
> generally, C is a frequent lowest-common-denominator language. Is my
> understanding right?
>

On most operating systems, there's some kind of binary executable
format that is compatible with basically any language, but is most
often described in C, so yes, C becomes the de facto language of these
kinds of things. But you also have another very good option, and that
is to keep all the binaries entirely separate, and use interprocess
communication between them. For example, you could have a Python
program that starts a Lisp interpreter as a subprocess, and
communicates with it via stdin/stdout; or a TCP or Unix socket can be
used for negotiating between groups of languages; or you can have
everything push stuff into a PostgreSQL database.

There are many options, depending on what kind of interaction you
need. I'm a big fan of using networking to communicate (ie TCP
sockets, or higher level constructs such as HTTP or WebSockets) as
they can be used by all manner of programs, even those running in
restricted environments such as inside a web browser. For instance, I
have a Pike program that manages my Twitch channel bot, and it can
signal a web page (JavaScript running in a web browser) using a
WebSocket to have it do things, and a Python program can talk to it
via the same sort of websocket to send it a message. Meanwhile a shell
script can trigger things by invoking Python, etc, etc. Easy to change
different parts out, because the communication lines are defined in
simple terms like "HTTP with JSON payload", which can be understood
easily by all languages.

If you actually need real function calls (like you say with Cython
being between C++ and Python), the hardest part is managing different
data types. Python code running in CPython already has a rich API for
this, but once you bring some other language into the mix, now you
have to think about the differences between different integer types,
or different string types. Unless your code is very carefully crafted,
you will probably find that it's just as much trouble - and just as
much of a performance hit - as it would be if you were using external
communication. It takes a lot of planning to properly take advantage
of polyglot intra-process communication :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pycharm Won't Do Long Underscore

2020-06-30 Thread Random832
On Wed, Jun 24, 2020, at 21:38, Grant Edwards wrote:
> On 2020-06-24, Peter J. Holzer  wrote:
> 
> > There is U+FF3F Fullwidth Low Line.
> >
> >> If there were, Python would not know what to do with it
> >
> > You can use it in variable names, but not at the beginning, and it isn't
> > equivalent to two underscores, of course:

It is, in fact, equivalent to a single underscore. This is reasonable, given 
the unicode rules [I assume identifier lookup uses NFKC] and how these 
characters function for East Asian users.

> Ouch.  Anybody caught using that should be fed to a large snake.

Honestly, if I were to suggest any change it'd be to fix it so it's allowed at 
the beginning of an identifier. Let each (human) language's community worry 
about coding conventions for code intended for speakers of that language 
instead of trying to impose things on the world as english-speakers.

>>> a=1
>>> a_b=2
>>> a
1
>>> a_b
2
>>> _
  File "", line 1
_
^
SyntaxError: invalid character in identifier
-- 
https://mail.python.org/mailman/listinfo/python-list