pep Questions
1
Solved
C++
I use a rigorous rule of capitalizing class names.
Over many years I tried to use the somewhat inconsistent rule of using lowercase names for the files—when writing in C++.
For example, clas...
1
I was reading through the PEP 484 -- Type Hints
when it is implemented, the function specifies the type of arguments it accept and return.
def greeting(name: str) -> str:
return 'Hello ' ...
2
Solved
PEP 440 lays out what is the accepted format for version strings of Python packages.
These can be simple, like: 0.0.1
Or complicated, like: 2016!1.0-alpha1.dev2
What is a suitable regex which co...
2
Solved
PEP 423 states that project names and package names should be the same and later gives an example where the project/package name contains a dot:
Yes:
Package name: "kheops.pyramid", i.e....
1
Solved
I see in some other people's Python code that they paste some checks before the docstring of the function; something like this:
def func(args):
if x_version != 1.7:
return
"""docstring is here"...
3
Solved
Let's say I have a file "icon.ico" and an url "url.com".
The'll be used just once within the class - "icon.ico" will be set to some window and we'll do the request to url in one method.
I hav...
Clayclaybank asked 11/1, 2016 at 11:28
14
Over the years, the more Python I write, the more I find myself agreeing with most of the guidelines, though I consistently and intentionally break some for my own reasons.
I'd be curious to...
1
Solved
I have been coding for about a year now in Python and I have just come across some code in a Theano tutorial that declares a variable at the top of the file:
__docformat__ = 'restructedtext en'
...
Fenton asked 26/8, 2015 at 3:55
1
Solved
On a small embedded Linux device with limited space, I am trying to place the large [10 Mb] Amazon (AWS) BotoCore library (https://github.com/boto/botocore) in a zip file to compress it and then im...
Thierry asked 12/6, 2015 at 16:47
1
Solved
I am trying to be a good Pythonista and following PEP 338 for my package I plan on deploying.
I am also trying to generate my executable scripts upon python setuptools install using setuptools en...
Invert asked 5/1, 2015 at 16:58
3
Solved
I would like to create a simple XMPP client in java that shares his location (XEP-0080) with other clients.
I already know I can use the smack library for XMPP and that it supports PEP, which is ne...
Prejudicial asked 5/3, 2010 at 14:22
2
Solved
What is the preferred style for assigning values to variables when the variables are nested several levels deep, have fairly long names, and are being assigned fairly long values/expressions?
For e...
7
Solved
I'm a fairly strong Python coder, but too much of my style is a little haphazard, and I'm sure there are more Pythonic solutions to many problems than the ones I come up with. Which PEPs are essent...
6
Solved
I learned from a similar question on imports that one should not mix "operational code" and import (they should be at the top).
What is the consensus around defining functions in the middle ...
Fascine asked 14/11, 2013 at 6:55
2
Tools like pep8 can check source code style, but they don't check if docstrings are fromatted according to pep257, pep287. Are there such tools?
Update
I decided to implement such a static ...
Upsetting asked 4/1, 2012 at 9:51
1
Solved
There is a question who treat about this but not talk about all the points I interested.
PEP 8 says about blank lines:
Separate top-level function and class definitions with two blank lines.
Th...
Fulfil asked 8/4, 2013 at 20:57
1
Solved
As some of you may know in python2.7/3.2 we'll get OrderedDict with PEP372 however one of the reason the PEP existed was because everyone did their own implementation and they were all sightly inco...
Dilute asked 20/3, 2010 at 17:39
7
Solved
Suppose I think I have a great idea for some feature that should be in python's standard library.
Not something of the magnitude of a new keyword etc, just a suggestion for another decorator that w...
© 2022 - 2024 — McMap. All rights reserved.