[issue37176] super() docs don't say what super() does

2019-06-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: > If you have to explain in a bpo issue how the doc should be read, that > proves exactly my point that it's confusing. The fact that it's > technically correct if you read it the right way is irrelevant. Do you expect the docs t

[issue37192] pip instal math3d - EROR

2019-06-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: In addition to being a third-party library, according to the output you posted, you're actually running Python 3.4 not 3.7. -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.o

[issue37176] super() docs don't say what super() does

2019-06-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I'm sorry to say that you're wrong here. I'm happy to be corrected. It is fair to say I failed to take the multiple inheritance case into account. Clearly super can't *only* look at the MRO of the first object since

[issue37176] super() docs don't say what super() does

2019-06-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: > > What matters is the __mro__ attribute of the first argument. It matters > because that is how the MRO actually is searched. > > By the way, if it was true (it is not), Yes, I see that now. > then what did you think was >

[issue37176] super() docs don't say what super() does

2019-06-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Jun 08, 2019 at 09:14:18PM +, Raymond Hettinger wrote: > Ideally, the text can also be made more compact. Having eight > paragraphs sends an implicit message that this is too complex to > understand and that it should be avoid

[issue34850] Emit a syntax warning for "is" with a literal

2019-06-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: > (message from a code of conduct violating troll deleted) How did Bachsau violate the code of conduct, and what evidence do you have that they were anything but 100% sincere in their comments? >From where I am sitting, the only person violating

[issue34850] Emit a syntax warning for "is" with a literal

2019-06-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: Bachsau, to respond to the substance of your comments: it is not the *primary* purpose of a compiler to teach, but compiler warnings on potentially wrong behaviour is a long-standing tradition in many languages, including Python. This is not the

[issue37273] from pickle import rick

2019-06-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: This looks like some sort of spam or joke. There's no explanation given of what this enhancement does, the PR seems to add only a rather suspicious looking triple-quoted string. (Possibly really bad ASCII art of a finger?) In the absence of any

[issue37304] compiler need support in(de)crement operation or all of it should have syntax error.

2019-06-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: For the reasons already discussed on the Stackoverflow link you gave, Python does not have pre- and post-increment and -decrement operators, and probably never will. I'm closing this ticket as Won't Fix, but if you wish to discuss it fu

[issue37306] "~/" not working with open() function in posix systems

2019-06-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Support for "~" isn't strictly part of the POSIX file system standard, it is a *shell* shortcut. As far as the file system is concerned, "~" is just a regular character like any other. --

[issue37377] unicode error should raise a value error

2019-06-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: It is a *syntax* error. You have written bad syntax, just as the error message says. Your \xXX code is too short, only 1 hex digit instead of 2. I disagree that this should be a value error: it isn't a bad value, it is bad syntax. I don'

[issue37379] Provide triggering AttributeError exception to __getattr__ for reraising

2019-06-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Could you supply a *simple* demonstration of a class showing this problem? I've looked at the uploaded "test6.py" (what happened to the other 5?) and don't see anything to do with either __getattr__ or property in it. ---

[issue37466] Move casting prompt after its validation in _raw_input()

2019-07-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't think that will work. If the user passes a non-string which is falsey, your patch will attempt to write it directly to the stream without converting it to a string. Try ``_raw_input(0)`` as an example. Tal Einat: > one would expect p

[issue37454] Clarify docs for math.log1p()

2019-07-01 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/issue37454> ___ ___ Python-bugs-list mailing list Unsubscr

[issue37490] poor documentation for .startswith, .endswith

2019-07-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: Here are links to the relevant docs: https://docs.python.org/3/library/stdtypes.html#str.startswith https://docs.python.org/3/library/stdtypes.html#str.endswith Both say: "With optional *start*, test string beginning at that position. With opti

[issue37490] poor documentation for .startswith, .endswith

2019-07-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: Perhaps it would help if we spelled out the behaviour more explicitly? str.startswith(prefix[, start=0[, end=len(string)]]) Return True if the slice of string between start (defaults to the beginning of the string) and end (defaults to the end o

[issue37506] os.mkdir creates invalid folder when path string has trailing space and slash

2019-07-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: > it would be better for an exception to be thrown rather than creating a > corrupt folder. I am not convinced that Python should refuse to create a perfectly valid directory because some components of Windows sometimes have trouble resolving t

[issue37512] Error in the documentation about string concatenation

2019-07-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: Eric is correct that this is a CPython optimization, it is not a language feature. Furthermore, it is an optimization that can be affected by rather subtle factors such as the operating system memory management. Here is a thread demonstrating that

[issue37515] `open("aux.txt", "w")` fails unexpectedly with FileNotFoundError on Windows

2019-07-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: For future reference, please don't post screen shots of plain text, as they make it unnecessarily difficult for blind or visually impaired developers to contribute (and yes, they do exist, I've worked with some, and at least one core devel

[issue37517] Improve error messages for Windows reserved file names

2019-07-06 Thread Steven D'Aprano
New submission from Steven D'Aprano : See #37515. Perhaps Windows builds can check for reserved file names and give a more descriptive error message in the event of IO error? (Eryksun also mentions two reserved names which Microsoft apparently does not document: "CONIN$&qu

[issue37517] Improve error messages for Windows reserved file names

2019-07-06 Thread Steven D'Aprano
Change by Steven D'Aprano : -- type: -> enhancement ___ Python tracker <https://bugs.python.org/issue37517> ___ ___ Python-bugs-list mailing list Unsub

[issue37568] Misleading UnBoundLocalError on assignment to closure variable

2019-07-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: The behaviour and error message is correct, and your interpretation is incorrect. You are not assigning to a closure variable on line 4; you are printing an unbound local variable on line 3, precisely as the error message says. That may not match

[issue37568] Misleading UnBoundLocalError on assignment to closure variable

2019-07-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: To clarify further, unlike (say) Lua, Python doesn't allow variables to change scope part-way through a function. (At least not without hacking the byte-code.) In any function, a name refers to precisely one of (1) a local, (2) a nonlocal, and (3

[issue37569] Complete your registration to Python tracker

2019-07-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: Seems to have been created in error. -- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue37541] get_python_lib() returns incorrect path for site-packages

2019-07-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: You say this is a problem affecting *Mac* users, but all of your examples show *Windows* paths. How do you know it affects Macs? You say that get_python_lib() returns the incorrect path, but you don't show us the output of calling get_python_lib

[issue37582] can you add this new feature about grammar?

2019-07-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: A new language feature like this needs to be discussed on Python-Ideas first, to get community feedback, to decide whether the feature is desired by the community, to iron-out any bugs in the specification, and decide whether or not you will need to

[issue37582] can you add this new feature about grammar?

2019-07-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: Oops, I accidentally removed xtreak, and then aeros167 accidentally removed me. -- nosy: +steven.daprano, xtreak type: -> enhancement ___ Python tracker <https://bugs.python.org

[issue37646] eval() in a list comprehension

2019-07-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: What leads you to believe that eval *shouldn't* work in the global scope in a comprehension? If not the global scope, which scope should it be, local or nonlocal? Is the behaviour documented differently? For reference, the current docs for eva

[issue36018] Add a Normal Distribution class to the statistics module

2019-07-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: I have a query about the documentation: The default *method* is "exclusive" and is used for data sampled from a population that can have more extreme values than found in the samples. ... Setting the *method* to "in

[issue37646] eval() in a list comprehension

2019-07-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm not sure we should be so quick to close this. At the very least, I think the documentation could be improved. It does seem desirable to have the invariant: `expression` == `eval("expression")` apply in any environment. Was the

[issue37770] implement __reversed__ on reversed types

2019-08-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: Both 3.7 and 3.8 are in feature-freeze, so the earliest we can get this would be 3.9. But before that, we have to decide on what reversing a reversed object means. it = reversed([1, 2, 3, 4]) next(it) list( reversed(it) ) Should that give [1, 2, 3]

[issue37808] Deprecate unbound super methods

2019-08-10 Thread Steven D'Aprano
New submission from Steven D'Aprano : As per the discussion here, let's deprecate unbound super methods. https://discuss.python.org/t/is-it-time-to-deprecate-unbound-super-methods/1833 -- messages: 349338 nosy: steven.daprano priority: normal severity: normal status:

[issue37809] Alias typing.NamedTuple to collections

2019-08-10 Thread Steven D'Aprano
New submission from Steven D'Aprano : As discussed in the thread starting here with Guido's message: https://mail.python.org/archives/list/python-id...@python.org/message/WTBXYJJ7CSGDLLJHHPHSH5ZCCA4C7QEP/ and these two follow-ups: https://mail.python.org/archives/list/python-id...@

[issue37818] Behaviors of binary bitwise operators contradicting documentation

2019-08-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: bools are integers, specifically they are a subclass of int: py> isinstance(True, int) True py> issubclass(bool, int) True so the behaviour is correct. -- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved statu

[issue30641] No way to specify "File name too long" error in except statement.

2017-06-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't understand what you actually are requesting here. Are you requesting a way to tell whether or not the filename is too long? You've already been told that the way to do that is to check errno, and you say that you already knew t

[issue30717] str.center() is not unicode aware

2017-06-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't think graphemes is the right term here. Graphemes are language dependent, for instance "dž" may be considered a grapheme in Croatian. https://en.wikipedia.org/wiki/D%C5%BE http://www.unicode.org/glossary/#grapheme I believe

[issue30717] str.center() is not unicode aware

2017-06-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries talks about *grapheme clusters*, not "graphemes" alone, and it seems clear to me that they are language dependent. For example, it says: The Unicode Standard provides default

[issue30736] Support Unicode 10.0

2017-06-22 Thread Steven D'Aprano
New submission from Steven D'Aprano: Unicode 10.0 is now finalized: http://blog.unicode.org/2017/06/announcing-unicode-standard-version-100.html It would be good if Python 3.7 would support it. (I think that Python currently supports Unicode 8?) -- messages: 296630

[issue30753] not able to execute print command on page 16 of documentation

2017-06-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is a bug in your code, not Python, and the error tells you how to fix it. You have to indent the block. >>> while b < 1000: ... print(b, end=',') ... a, b = b, a+b Remember to press TAB or spacebar inside indent

[issue30772] If I make an attribute "[a unicode version of B]", it gets assigned to "[ascii B]", and so on.

2017-06-27 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <http://bugs.python.org/issue30772> ___ ___ Python-bugs-list mailing list Unsubscr

[issue30792] Add contextlib.convert_exception manager

2017-06-28 Thread Steven D'Aprano
New submission from Steven D'Aprano: As discussed on Python-Ideas, there's some interest in a context manager that can convert an exception from one type to another (similarly to the way PEP 479 has StopIteration converted to RuntimeError. See the thread starting here: https://mail.

[issue30772] Normalise non-ASCII variable names in __all__

2017-06-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: I think that the names in __all__ should have the same NFKC normalisation applied as the identifiers. Re-opening for 3.7. -- resolution: not a bug -> stage: resolved -> status: closed -> open title: If I make an attribute " -&g

[issue30810] Germany made the upper case ß official. 'ß'.upper() should now return ẞ.

2017-06-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: Although I'm not German, I'm rather pleased by this. Nevertheless I don't think we actually need to do anything yet. I think it is more important that Python follows the standard Unicode behaviour. If and when Unicode recommend that &#x

[issue30875] round(number[, digits]) does not return value with >12 decimal places

2017-07-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Using "round(number[, digits])" in a program I get no rounding It works for me. Can you show an example of it not working? py> round(1.23456789012345, 3) 1.235 > Using the same command in the terminal interpreter it returns > .

[issue30887] Syntax checking confuses Try: class_instance_name as ... is used before glabal declaration

2017-07-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: Please copy and paste (don't retype from memory!) the *exact* error you are getting. You should be seeing something like: SyntaxWarning: name 'current_user' is used prior to global declaration (at least that's the warning I'm

[issue30887] Syntax checking confuses Try: class_instance_name as ... is used before glabal declaration

2017-07-09 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.pyth

[issue30894] Python 3.6.1 String Literal Error Not Going to sys.stderr

2017-07-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: Before Python runs your code, it compiles it to byte-code. A SyntaxError means that the code cannot be compiled, and so it does not run. So the SyntaxError is raised *before* any of the code runs, and standard error is not re-directed. This is exp

[issue30895] Decimal arithmetic sum error

2017-07-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: Also, for the future, please do not post screen shots of text. Copy and Paste the text from the console. Thank you. -- nosy: +steven.daprano ___ Python tracker <http://bugs.python.org/is

[issue30717] str.center() is not unicode aware

2017-07-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thank you, but I cannot review your C code. Can you start by telling us what the two functions: unicodedata.grapheme_cluster_break() unicodedata.break_graphemes() take as arguments, and what they return? If we were to call help(function), what would w

[issue30932] Identity comparison ("is") fails for floats in Python3 but works in Python2

2017-07-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug. Whether Python allocates one, or two, float objects for a particular floating point value is dependent on the implementation and not a language guarantee. The language does not promise that two floats with the value 7.3 will be the

[issue30957] pathlib: Path and PurePath cannot be subclassed

2017-07-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Python 3.4, 3.5 and 3.6 are in feature-freeze, so this enhancement can only apply to 3.7. You say that pathlib.Path "can't be subclassed", but then immediately show an example of subclassing it: >>> class MyPath(pathlib.Path):

[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2017-07-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Apart from being "cool", what is the purpose of this key argument? For the example shown, where you extract an item from tuple data: >>> median_low([(1, 2), (3, 3), (4, 1)], key=lambda elem: elem[0]) (3, 3) I'm not sure I under

[issue31012] suggestion: allow termination argument in argparse to be specified as argument

2017-07-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: > This means that a user who wishes to use '--' in some other way is out of > luck. I think that's a feature, not a limitation. Command line arguments should use broadly consistent conventions. I don't want one program to us

[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2017-07-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thanks for explaining your use-case. Although the median_* functions don't perform arithmetic on their data, they are still conceptually mathematical functions that operate on numbers and I'm reluctant to support arbitrary objects with

[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2017-07-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: I've given this some more thought, and I think that a "key" argument would make sense for a general selection function. The general selection problem is: given a set of items A, and a number k between 1 and the number of items, retu

[issue31063] List Comprehension Bug

2017-07-27 Thread Steven D'Aprano
Steven D'Aprano added the comment: In the future, please do not post screenshots, please copy and paste the text. Screenshots are hard or impossible for the blind or visually impaired to see, but they can use a screen reader to work with text. -- nosy: +steven.da

[issue31085] Add option for namedtuple to name its result type automatically

2017-07-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: If you don't care about the name, just pass '_' for it. -- nosy: +steven.daprano ___ Python tracker <http://bug

[issue30717] Add unicode grapheme cluster break algorithm

2017-08-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Aug 03, 2017 at 11:21:38AM +, Serhiy Storchaka wrote: > Should iterators provide just substrings or their positions? [...] I think we're breaking new ground here and I'm not sure what the right API should be. Should we fol

[issue20844] SyntaxError: encoding problem: iso-8859-1 on Windows

2017-08-08 Thread Steven Winfield
Steven Winfield added the comment: I've just been bitten by this on 3.6.2, Windows Server 2008 R2, when running the setup.py script for QuantLib-SWIG: https://github.com/lballabio/QuantLib-SWIG/blob/v1.10.x/Python/setup.py It seems there is different behaviour depending on whether: *

[issue31142] python shell crashed while input quotes in print()

2017-08-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm afraid your error report isn't completely clear. What do you mean "input single quote in print"? Do you mean this? print(') You say IDLE "crashed". What do you mean? Do you mean the IDLE application put up a

[issue31141] Start should be a keyword argument of the built-in sum

2017-08-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: This seems like a reasonable enhancement to `sum` to me. Since 2.7 is in feature freeze, this can only apply to 3.7. -- nosy: +steven.daprano type: behavior -> enhancement versions: -Python 2.7 ___ Python

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm not sure whether this is a bug or a feature. In the examples you show, we have *both* an IndentationError/TabError and missing parentheses around print. So I'm almost inclined to say that this is right: - you get an IndentationErr

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: > > Perhaps the check needs to be limited to just the exact type. > Looks reasonable to me. Do you want to provide a PR Martijn? You realise that is making the current traceback *less* informative instead of more informative? I think that

[issue31222] datetime.py implementation of .replace inconsistent with C implementation

2017-08-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: I agree that returning type(self) or self.__class__ (not sure which is better) is the right thing to do. It might be possible to argue that the Python version is buggy, if the C version is treated as the reference implementation and the Python versio

[issue31283] Inconsistent behaviours with explicit and implicit inheritance from object

2017-08-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't think this is a bug, I think it is standard behaviour which should be expected if you think about Python's execution model. If you inherit from object implicitly: class Spam: ... then the interpreter gets to pick the base class,

[issue31283] Inconsistent behaviours with explicit and implicit inheritance from object

2017-08-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: > the documentation states that the two examples I gave should yield identical > results. Got a link to the specific documentation that says this? And a suggested improvement? -- assignee: -> docs@python components: +Documentati

[issue31322] SimpleNamespace deep copy

2017-09-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: > When using nested SimpleNamespaces, a making a copy by using > > new_NS=SimpleNamespace(**namespace.__dict__.copy()) In general, you shouldn't call or directly access dunder attributes. There are exceptions, but generally they'

[issue31514] There is a problem with the setdefault type conversion in the tuple

2017-09-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: The demo code you give seems to be working perfectly correctly. I don't think anything here is a bug. (1) You are working with a dict, not a tuple. (2) The potint.__repr__ method does NOT have a bug. (3) de['four'] is NOT an int, it is a

[issue35200] Make the half-open range behaviour easier to teach

2018-11-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: Raymond: > I'm in agreement with the comments that the proposed __str__ revision is > confusing. In what way is it "confusing"? I'm especially perplexed that Julien apparently thinks it is confusing when emitted by str(),

[issue35339] Populating instances of class automatically

2018-11-28 Thread Steven D'Aprano
Change by Steven D'Aprano : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue35340] global symbol "freegrammar" should be made static ore renamed

2018-11-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: What "freegrammar" symbol are you referring to? Why should it be made static or renamed? 2.7 is something like a decade old now, why do you describe this as a new symbol? -- nosy: +steven.daprano ___

[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: Looks like we have a stand-off between core devs, and no BDFL to make a ruling. There is support for the feature from at least Barry and Raymond (although I think Guido was cool on the idea, maybe?). Gregory, do you feel strongly enough about this

[issue35377] urlsplit scheme argument broken

2018-12-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't think this is broken, but I do think it could be documented better. You have to read the documentation for `urlparse` to see this: [Quote] Following the syntax specifications in RFC 1808, urlparse recognizes a netloc only if it i

[issue35382] Something wrong with pymysql

2018-12-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: Also, for future reference, please spend the time to make a good bug report, showing the minimum code needed to reproduce the error, and the full error, not just a summary. Please read this before your next bug report: http://sscce.org/ Than

[issue35377] urlsplit scheme argument broken

2018-12-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: You haven't given a convincing reason that there is a problem that needs fixing, or if there is, that your patch is the right way to fix it. You have already pointed out that there is at least one scheme where :/// is part of a valid URL: "f

[issue35377] urlparse doesn't validate the scheme

2018-12-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm changing the name to better describe the problem, and suggest a better solution. The urlparse.urlsplit and .urlunsplit functions currently don't validate the scheme argument, if given. According to the RFC: Scheme names consist o

[issue35397] Undeprecate and document urllib.parse.unwrap

2018-12-03 Thread Steven D'Aprano
New submission from Steven D'Aprano : The urllib.parse module contains an undocumented function unwrap: unwrap('') --> 'type://host/path' This is useful. I've been re-inventing this function in many of my scripts, because I didn't know it exist

[issue35403] support application/wasm in mimetypes and http.server

2018-12-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: Python 3.7 is in feature-freeze, so any new features like this will have to be 3.8 only. -- nosy: +steven.daprano versions: -Python 3.7 ___ Python tracker <https://bugs.python.org/is

[issue35407] Datetime function with selenium

2018-12-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is for reporting bugs in the Python interpreter and standard library, not for asking for help with bugs in your own code. The code you show contains a syntax error (some of the indentation is wrong) and at least one undefined variable, "

[issue35431] The math module should provide a function for computing binomial coefficients

2018-12-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: You import reduce but never use it :-) +1 for this, I certainly miss it too. -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/is

[issue35435] Documentation of 3.3 is available

2018-12-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: Documentation is available for all versions going back to Python 1.4. https://docs.python.org/release/1.4/ As it should be: I'm surely not the only person who has need to check old versions of the documentation from time to time. Not everyone is

[issue35431] The math module should provide a function for computing binomial coefficients

2018-12-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Dec 07, 2018 at 12:04:44AM +, Raymond Hettinger wrote: > Also, I'm not sure what the predominant choice for variable names > should be, "n things taken r at a time" or "n things taken k at time". > >

[issue35431] The math module should provide a function for computing binomial coefficients

2018-12-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: > > Mathematically, `binomial(n, k)` for `k > n` is defined as 0. > > It's not so clear cut. You can find different definitions out there. > Knuth et. al., for example, in the book "Concrete Mathematics", extend > t

[issue35431] The math module should provide a function for computing binomial coefficients

2018-12-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Dec 07, 2018 at 01:37:36PM +, Mark Dickinson wrote: > I'd personally prefer that floats not be accepted; Agreed. We can always add support for floats later, but its hard to remove it if it turns out to be problematic. We ought to

[issue35431] Add a function for computing binomial coefficients to the math module

2018-12-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Brett, what was the purpose of the title change? > title: The math module should provide a function for computing > binomial coefficients -> Add a function for computing binomial > coefficients t

[issue35105] Document that CPython accepts "invalid" identifiers

2018-12-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Any ideas? Or I will create a PR in a week without 'CPython implementation > detail' I don't think we want to give any stability guarantees for this. Perhaps we should explicitly state that this is not guaranteed behaviour and

[issue35443] Add Tail Call Optimization

2018-12-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I see nothing wrong with adding Tail Call Optimization to Python. That's nice. Is that supposed to be an argument that convinces us? You are hardly the first person ever to suggest TCO for Python: https://duckduckgo.com/?q=tail+call+opti

[issue35449] documenting objects

2018-12-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: Minor note on terminology: classes and functions are themselves objects. I think that help() (or in particular PyDoc in general) should support any instance with a __doc__ attribute. Its failure to do so is causing pain, see #12154. --

[issue35449] documenting objects

2018-12-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Is there any discussion concerning what syntax might be used for > docstrings associated with objects ? I don't know about PyDoc in general, but I would expect help(obj) to just use obj.__doc__ which will return the instance docstring if

[issue35449] documenting objects

2018-12-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: I asked: > > Are you suggesting we need new syntax to automatically assign docstrings > > to instances? Stefan replied: > No, I'm not suggesting that. And then immediately went on to suggest new syntax for automatically bindi

[issue35496] left-to-right violation in match order

2018-12-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: > See attached script, which is self-explanatory. I'm glad one of us thinks so, because I find it clear as mud. I spent *way* longer on this than I should have, but I simplified your sample code to the best of my ability. (See attached.) As

[issue35522] os.stat().st_ctime and time.time() mismatch

2018-12-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: In the future, please describe your problem here, on the bug tracker, not just by linking to Stackoverflow. You asked: "Why is the file creation time [less than] the time measured before it is created?" (You actually say "greater th

[issue35530] Counter-intuitive logging API

2018-12-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: The call to logging.error() is irrelevant, since there's no expectation that the module-level function will necessarily output the same as a method of a specific instance logger.error(). I agree that is it quite curious that the first call to lo

[issue35530] Counter-intuitive logging API

2018-12-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: > That's true. Maybe and warning or Exception can be raise? Why would we raise a warning or exception for expected behaviour? logging.error() and some_instance.error() don't necessarily produce the same output. What would the exception sa

[issue35530] Counter-intuitive logging API

2018-12-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Wed, Dec 19, 2018 at 10:37:22AM +, Mark Dickinson wrote: > > Mark Dickinson added the comment: > > The call to `logging.error` is *not* irrelevant here. It's causing an > implicit, and surprising (albeit documented), call t

[issue35544] unicode.encode docstring says return value can be unicode

2018-12-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: Encoding and decoding, in the most general sense, can include unicode -> unicode and bytestring -> bytestring. I can't see any standard unicode->unicode encodings in Python 2.7 https://docs.python.org/2/library/codecs.html but we

[issue35544] unicode.encode docstring says return value can be unicode

2018-12-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I'll keep on finding "-> string or unicode" misleading. How is it misleading when its true? -- ___ Python tracker <https

[issue35549] Add partial_match: bool = False argument to unicodedata.lookup

2018-12-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: I love the idea, but dislike the proposed interface. As a general rule of thumb, Guido dislikes "constant bool parameters", where you pass a literal True or False to a parameter to a function to change its behaviour. Obviously this is

[issue35549] Add partial_match: bool = False argument to unicodedata.lookup

2018-12-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: Here's my implementation: from unicodedata import name from unicodedata import lookup as _lookup from fnmatch import translate from re import compile, I _NAMES = None def getnames(): global _NAMES if _NAMES is None: _NAMES = []

[issue35573] is_HDN is returns false positive and false negative value for two test cases respectively

2018-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: What is the module "cookiejar" you are importing? Is that a third-party module? It doesn't seem to be in the standard library. There is a module `http.cookiejar` but it doesn't seem to have an `is_HDN` function. If this is a th

<    5   6   7   8   9   10   11   12   13   14   >